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

(-)a/C4/HTML5Media.pm (-2 / +24 lines)
Lines 49-58 sub gethtml5media { Link Here
49
    my $HTML5MediaWidth;
49
    my $HTML5MediaWidth;
50
    my @HTML5MediaExtensions = split( /\|/, C4::Context->preference("HTML5MediaExtensions") );
50
    my @HTML5MediaExtensions = split( /\|/, C4::Context->preference("HTML5MediaExtensions") );
51
    my $HTML5MediaYouTube    = C4::Context->preference("HTML5MediaYouTube");
51
    my $HTML5MediaYouTube    = C4::Context->preference("HTML5MediaYouTube");
52
    my $HTML5MediaVimeo      = C4::Context->preference("HTML5MediaVimeo");
52
    my $marcflavour          = C4::Context->preference("marcflavour");
53
    my $marcflavour          = C4::Context->preference("marcflavour");
53
54
54
    foreach my $HTML5Media_field (@HTML5Media_fields) {
55
    foreach my $HTML5Media_field (@HTML5Media_fields) {
55
        my $is_youtube = 0;
56
        my $is_youtube = 0;
57
        my $is_vimeo = 0;
56
        my %HTML5Media;
58
        my %HTML5Media;
57
59
58
        # protocol
60
        # protocol
Lines 112-117 sub gethtml5media { Link Here
112
                    next;                                   # do not embed youtube videos
114
                    next;                                   # do not embed youtube videos
113
                }
115
                }
114
            }
116
            }
117
            if (grep /vimeo/, $HTML5Media_field->subfield('u') ) {
118
                if ($HTML5MediaVimeo == 1) {
119
                    my $url = $HTML5Media_field->subfield('u');
120
                    next unless $url =~ m{^.*(vimeo.com/)([^#\&\?]*).*};
121
122
                    my $video_id = $2;
123
#$HTML5Media{srcblock} = sprintf 'https://player.vimeo.com/video/%s?badge=0&autopause=0&player_id=0&app_id=58479', $video_id;
124
                    $HTML5Media{srcblock} = sprintf 'https://player.vimeo.com/video/%s', $video_id;
125
126
                    $HTML5Media{is_vimeo} = 1;
127
                    $is_vimeo = 1;
128
                }
129
               else {
130
                   next; # do not embed vimeo videos
131
               }
132
            }
115
        } elsif ( $HTML5Media_field->subfield('a')
133
        } elsif ( $HTML5Media_field->subfield('a')
116
            && $HTML5Media_field->subfield('d')
134
            && $HTML5Media_field->subfield('d')
117
            && $HTML5Media_field->subfield('f') )
135
            && $HTML5Media_field->subfield('f') )
Lines 152-158 sub gethtml5media { Link Here
152
        else {
170
        else {
153
            $HTML5Media{extension} = ( $HTML5Media{srcblock} =~ m/([^.]+)$/ )[0];
171
            $HTML5Media{extension} = ( $HTML5Media{srcblock} =~ m/([^.]+)$/ )[0];
154
        }
172
        }
155
        if ( ( !grep /\Q$HTML5Media{extension}\E/, @HTML5MediaExtensions ) && ( $is_youtube != 1 ) ) {
173
        if ( ( !grep /\Q$HTML5Media{extension}\E/, @HTML5MediaExtensions ) && ( $is_youtube != 1) && ( $is_vimeo != 1 ) ) {
156
            next;    # not a specified media file
174
            next;    # not a specified media file
157
        }
175
        }
158
176
Lines 161-167 sub gethtml5media { Link Here
161
            $HTML5Media{mime} = 'video/webm';
179
            $HTML5Media{mime} = 'video/webm';
162
            $HTML5Media{type} = 'video';
180
            $HTML5Media{type} = 'video';
163
        }
181
        }
164
182
        # vimeo
183
        if ($is_vimeo == 1) {
184
            $HTML5Media{mime} = 'video/webm';
185
            $HTML5Media{type} = 'video';
186
        }
165
        # mime
187
        # mime
166
        if ( $HTML5Media_field->subfield('c') ) {
188
        if ( $HTML5Media_field->subfield('c') ) {
167
            $HTML5Media{codecs} = $HTML5Media_field->subfield('c');
189
            $HTML5Media{codecs} = $HTML5Media_field->subfield('c');
(-)a/installer/data/mysql/atomicupdate/bug_19339-HTML5MediaVimeo_syspref.pl (+15 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "19339",
6
    description => "Enhance streaming cataloging to include Vimeo",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES ('HTML5MediaVimeo',0,'Embed|Don\'t embed','Vimeo links as videos','YesNo')});
12
13
        say_success( $out, "Added new system preference 'HTML5MediaVimeo'" );
14
    },
15
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 319-324 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
319
('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'),
319
('HTML5MediaEnabled','not','not|opac|staff|both','Show a tab with a HTML5 media player for files catalogued in field 856','Choice'),
320
('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'),
320
('HTML5MediaExtensions','webm|ogg|ogv|oga|vtt','','Media file extensions','free'),
321
('HTML5MediaYouTube',0,'Embed|Don\'t embed','YouTube links as videos','YesNo'),
321
('HTML5MediaYouTube',0,'Embed|Don\'t embed','YouTube links as videos','YesNo'),
322
('HTML5MediaVimeo',0,'Embed|Don\'t embed','Vimeo links as videos','YesNo'),
322
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'),
323
('IdRef','0','','Disable/enable the IdRef webservice from the OPAC detail page.','YesNo'),
323
('ILLCheckAvailability', 0, '', 'If ON, during the ILL request process third party sources will be checked for current availability', 'YesNo'),
324
('ILLCheckAvailability', 0, '', 'If ON, during the ILL request process third party sources will be checked for current availability', 'YesNo'),
324
('ILLDefaultStaffEmail', '', NULL, 'Fallback email address for staff ILL notices to be sent to in the absence of a branch address', 'Free'),
325
('ILLDefaultStaffEmail', '', NULL, 'Fallback email address for staff ILL notices to be sent to in the absence of a branch address', 'Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (+6 lines)
Lines 339-344 Enhanced content: Link Here
339
                  1: "Embed"
339
                  1: "Embed"
340
                  0: "Don't embed"
340
                  0: "Don't embed"
341
            - YouTube links as videos.
341
            - YouTube links as videos.
342
        -
343
            - pref: HTML5MediaVimeo
344
              choices:
345
                  1: "Embed"
346
                  0: "Don't embed"
347
            - Vimeo links as videos.
342
    OverDrive:
348
    OverDrive:
343
        -
349
        -
344
            - pref: OPACOverDrive
350
            - pref: OPACOverDrive
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+2 lines)
Lines 866-871 Link Here
866
                        <p>
866
                        <p>
867
                            [% IF HTML5MediaSet.is_youtube %]
867
                            [% IF HTML5MediaSet.is_youtube %]
868
                                <iframe id="player" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]"></iframe>
868
                                <iframe id="player" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]"></iframe>
869
                            [% ELSIF HTML5MediaSet.is_vimeo %]
870
                                <iframe id="player" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]"></iframe>
869
                            [% ELSE %]
871
                            [% ELSE %]
870
                                <!-- prettier-ignore-start -->
872
                                <!-- prettier-ignore-start -->
871
                                                <[% HTML5MediaParent | html %] controls preload=none>
873
                                                <[% HTML5MediaParent | html %] controls preload=none>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-1 / +2 lines)
Lines 975-980 Link Here
975
                                    <p>
975
                                    <p>
976
                                        [% IF HTML5MediaSet.is_youtube %]
976
                                        [% IF HTML5MediaSet.is_youtube %]
977
                                            <iframe id="player" type="text/html" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]" frameborder="0"></iframe>
977
                                            <iframe id="player" type="text/html" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]" frameborder="0"></iframe>
978
                                        [% ELSIF HTML5MediaSet.is_vimeo %]
979
                                            <iframe id="player" type="text/html" width="640" height="360" src="[% HTML5MediaSet.srcblock | url %]" frameborder="0"></iframe>
978
                                        [% ELSE %]
980
                                        [% ELSE %]
979
                                            [% SET ctrl_preload = ' controls preload=none' #translatability %]
981
                                            [% SET ctrl_preload = ' controls preload=none' #translatability %]
980
                                            <!-- prettier-ignore-start -->
982
                                            <!-- prettier-ignore-start -->
981
- 

Return to bug 19339