View | Details | Raw Unified | Return to bug 19339
Collapse All | Expand All

(-)a/C4/HTML5Media.pm (-2 / +19 lines)
Lines 51-56 sub gethtml5media { Link Here
51
    my $HTML5MediaYouTube    = C4::Context->preference("HTML5MediaYouTube");
51
    my $HTML5MediaYouTube    = C4::Context->preference("HTML5MediaYouTube");
52
    my $marcflavour          = C4::Context->preference("marcflavour");
52
    my $marcflavour          = C4::Context->preference("marcflavour");
53
    my $isyoutube            = 0;
53
    my $isyoutube            = 0;
54
    my $isvimeo            = 0;
55
    my @vimeoVideos = ();
56
    my $VimeoMedia;
57
    my $MediaVimeo    = C4::Context->preference("HTML5MediaVimeo");
58
    
54
    foreach my $HTML5Media_field (@HTML5Media_fields) {
59
    foreach my $HTML5Media_field (@HTML5Media_fields) {
55
        my %HTML5Media;
60
        my %HTML5Media;
56
        # protocol
61
        # protocol
Lines 116-121 sub gethtml5media { Link Here
116
               else {
121
               else {
117
                   next; # do not embed youtube videos
122
                   next; # do not embed youtube videos
118
               }
123
               }
124
            } elsif (grep /vi\.?meo/, $HTML5Media_field->subfield('u') ) {
125
               $isvimeo = 1;
126
               if ($MediaVimeo == 1) {
127
                    # push
128
                    $VimeoMedia = $HTML5Media_field->subfield('u');
129
                    push @vimeoVideos, $VimeoMedia;
130
               }
119
            }
131
            }
120
        }
132
        }
121
        elsif ( $HTML5Media_field->subfield('a') && $HTML5Media_field->subfield('d') && $HTML5Media_field->subfield('f') ) {
133
        elsif ( $HTML5Media_field->subfield('a') && $HTML5Media_field->subfield('d') && $HTML5Media_field->subfield('f') ) {
Lines 145-151 sub gethtml5media { Link Here
145
        else {
157
        else {
146
            $HTML5Media{extension} = ($HTML5Media{srcblock} =~ m/([^.]+)$/)[0];
158
            $HTML5Media{extension} = ($HTML5Media{srcblock} =~ m/([^.]+)$/)[0];
147
        }
159
        }
148
        if ( ( !grep /\Q$HTML5Media{extension}\E/, @HTML5MediaExtensions ) && ( $isyoutube != 1) ) {
160
        if ( ( !grep /\Q$HTML5Media{extension}\E/, @HTML5MediaExtensions ) && ( $isyoutube != 1) && ( $isvimeo != 1) ) {
149
            next; # not a specified media file
161
            next; # not a specified media file
150
        }
162
        }
151
        # youtube
163
        # youtube
Lines 159-164 sub gethtml5media { Link Here
159
        ### from subfield q…
171
        ### from subfield q…
160
        if ( $HTML5Media_field->subfield('q') ) {
172
        if ( $HTML5Media_field->subfield('q') ) {
161
            $HTML5Media{mime} = $HTML5Media_field->subfield('q');
173
            $HTML5Media{mime} = $HTML5Media_field->subfield('q');
174
            if ( $HTML5Media{mime} eq 'video' ) {
175
               $HTML5Media{mime} = 'video/webm';
176
            }
162
        }
177
        }
163
        ### …or from file extension and codecs…
178
        ### …or from file extension and codecs…
164
        elsif ( $HTML5Media{codecs} ) {
179
        elsif ( $HTML5Media{codecs} ) {
Lines 222-228 sub gethtml5media { Link Here
222
            $HTML5Media{type} = 'track';
237
            $HTML5Media{type} = 'track';
223
        }
238
        }
224
        # push
239
        # push
225
        if ( $HTML5Media{srcblock} && $HTML5Media{type} ) {
240
        if ( $HTML5Media{srcblock} && $HTML5Media{type} && ( $isvimeo != 1) ) {
226
            push (@HTML5Media_sets, \%HTML5Media);
241
            push (@HTML5Media_sets, \%HTML5Media);
227
        }
242
        }
228
    }
243
    }
Lines 256-261 sub gethtml5media { Link Here
256
        HTML5MediaSets     => \@HTML5Media_sets,
271
        HTML5MediaSets     => \@HTML5Media_sets,
257
        HTML5MediaParent   => $HTML5MediaParent,
272
        HTML5MediaParent   => $HTML5MediaParent,
258
        HTML5MediaWidth    => $HTML5MediaWidth,
273
        HTML5MediaWidth    => $HTML5MediaWidth,
274
        VimeoMediaEnabled  => scalar(@vimeoVideos) > 0,
275
        VimeoMediaSets     => \@vimeoVideos,
259
    );
276
    );
260
}
277
}
261
278
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 193-198 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
193
('HouseboundModule',0,'','If ON, enable housebound module functionality.','YesNo'),
193
('HouseboundModule',0,'','If ON, enable housebound module functionality.','YesNo'),
194
('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'),
194
('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'),
195
('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'),
195
('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'),
196
('HTML5MediaVimeo',0,'Embed|Don\'t embed','Vimeo links as videos','YesNo'),
196
('HTML5MediaYouTube',0,'Embed|Don\'t embed','YouTube links as videos','YesNo'),
197
('HTML5MediaYouTube',0,'Embed|Don\'t embed','YouTube links as videos','YesNo'),
197
('IDreamBooksReadometer','0','','Display Readometer from IDreamBooks.com','YesNo'),
198
('IDreamBooksReadometer','0','','Display Readometer from IDreamBooks.com','YesNo'),
198
('IDreamBooksResults','0','','Display IDreamBooks.com rating in search results','YesNo'),
199
('IDreamBooksResults','0','','Display IDreamBooks.com rating in search results','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+10 lines)
Lines 14636-14641 if( CheckVersion( $DBversion ) ) { Link Here
14636
    print "Upgrade to $DBversion done (Bug 18811 - Visibility settings inconsistent between framework and authority editor)\n";
14636
    print "Upgrade to $DBversion done (Bug 18811 - Visibility settings inconsistent between framework and authority editor)\n";
14637
}
14637
}
14638
14638
14639
$DBversion = '17.06.00.006';
14640
if( CheckVersion( $DBversion ) ) {
14641
    $dbh->do(q{
14642
        INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HTML5MediaVimeo','','Vimeo links as videos','Embed|Don\'t embed','YesNo')
14643
        });
14644
14645
    SetVersion( $DBversion );
14646
    print "Upgrade to $DBversion done (Bug 19339 - Enhance streaming cataloging to include Vimeo )\n";
14647
}
14648
14639
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
14649
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
14640
# SEE bug 13068
14650
# SEE bug 13068
14641
# if there is anything in the atomicupdate, read and execute it.
14651
# if there is anything in the atomicupdate, read and execute it.
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (+6 lines)
Lines 345-350 Enhanced Content: Link Here
345
                  yes: "Embed"
345
                  yes: "Embed"
346
                  no: "Don't embed"
346
                  no: "Don't embed"
347
            - YouTube links as videos.
347
            - YouTube links as videos.
348
        -
349
            - pref: HTML5MediaVimeo
350
              choices:
351
                  yes: "Embed"
352
                  no: "Don't embed"
353
            - Vimeo links as videos.
348
    Plugins:
354
    Plugins:
349
        -
355
        -
350
            - pref: UseKohaPlugins
356
            - pref: UseKohaPlugins
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-4 / +9 lines)
Lines 616-622 Link Here
616
                            <li id="tab_images"><a href="#images">Images</a></li>
616
                            <li id="tab_images"><a href="#images">Images</a></li>
617
                        [% END %]
617
                        [% END %]
618
618
619
                        [% IF ( HTML5MediaEnabled && HTML5MediaSets ) %]
619
                        [% IF ( HTML5MediaEnabled && HTML5MediaSets ) || ( VimeoMediaEnabled && VimeoMediaSets ) %]
620
                            [% IF ( defaulttab == 'media' ) %]<li id="tab_html5media" class="ui-tabs-active">[% ELSE %]<li id="tab_html5media">[% END %]<a href="#html5media">Play media</a></li>
620
                            [% IF ( defaulttab == 'media' ) %]<li id="tab_html5media" class="ui-tabs-active">[% ELSE %]<li id="tab_html5media">[% END %]<a href="#html5media">Play media</a></li>
621
                        [% END %]
621
                        [% END %]
622
622
Lines 1012-1018 Link Here
1012
                            </div> <!-- / #editions -->
1012
                            </div> <!-- / #editions -->
1013
                        [% END # / IF OPACFRBRizeEditions && XISBNS %]
1013
                        [% END # / IF OPACFRBRizeEditions && XISBNS %]
1014
1014
1015
                        [% IF ( HTML5MediaEnabled ) %]
1015
                         [% IF ( VimeoMediaEnabled ) %]
1016
                                 <script src="[% interface %]/[% theme %]/js/player-v2.0.1.js"></script>
1017
                        [% END # / IF VimeoMediaEnabled %]
1018
                        [% IF ( HTML5MediaEnabled ) || ( VimeoMediaEnabled ) %]
1016
                            <div id="html5media">
1019
                            <div id="html5media">
1017
                              [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
1020
                              [% FOREACH HTML5MediaSet IN HTML5MediaSets %]
1018
                                <p>
1021
                                <p>
Lines 1023-1030 Link Here
1023
                                  </[% HTML5MediaParent %]>
1026
                                  </[% HTML5MediaParent %]>
1024
                                </p>
1027
                                </p>
1025
                              [% END %]
1028
                              [% END %]
1029
                              [% FOREACH VimeoMediaSet IN VimeoMediaSets %]
1030
                                   <div data-vimeo-url="[% VimeoMediaSet %]" class="vimeo_player"></div>
1031
                              [% END %]
1026
                            </div>
1032
                            </div>
1027
                        [% END # / IF HTML5MediaEnabled %]
1033
                        [% END # / IF HTML5MediaEnabled # / IF VimeoMediaEnabled %]
1028
1034
1029
                        [% IF ( OPACLocalCoverImages && localimages.size ) %]
1035
                        [% IF ( OPACLocalCoverImages && localimages.size ) %]
1030
                            <div id="images">
1036
                            <div id="images">
1031
- 

Return to bug 19339