Bugzilla – Attachment 45331 Details for
Bug 14168
enhance streaming cataloging to include youtube
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14168 - enhance streaming cataloging to include youtube
Bug-14168---enhance-streaming-cataloging-to-includ.patch (text/plain), 2.50 KB, created by
Mirko Tietgen
on 2015-12-02 16:45:54 UTC
(
hide
)
Description:
Bug 14168 - enhance streaming cataloging to include youtube
Filename:
MIME Type:
Creator:
Mirko Tietgen
Created:
2015-12-02 16:45:54 UTC
Size:
2.50 KB
patch
obsolete
>From a786c866b5bb9e0dea1afd212959cf0a3d9fcfea Mon Sep 17 00:00:00 2001 >From: Mirko Tietgen <mirko@abunchofthings.net> >Date: Thu, 22 Oct 2015 19:39:37 +0200 >Subject: [PATCH] Bug 14168 - enhance streaming cataloging to include youtube > >Initial commit. POCish. >--- > C4/HTML5Media.pm | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) > >diff --git a/C4/HTML5Media.pm b/C4/HTML5Media.pm >index c8c8a77..12ae939 100644 >--- a/C4/HTML5Media.pm >+++ b/C4/HTML5Media.pm >@@ -22,7 +22,7 @@ use warnings; > > use C4::Context; > use MARC::Field; >- >+use WWW::YouTube::Download qw(playback_url); > > =head1 HTML5Media > >@@ -96,6 +96,14 @@ sub gethtml5media { > # src > if ( $HTML5Media_field->subfield('u') ) { > $HTML5Media{srcblock} = $HTML5Media_field->subfield('u'); >+ if (grep /youtube/, $HTML5Media_field->subfield('u') ) { >+ my $youtube = WWW::YouTube::Download->new; >+ $HTML5Media{srcblock} = $youtube->playback_url( >+ $HTML5Media_field->subfield('u'), { >+ 'fmt' => '43' #webm >+ } >+ ); >+ } > } > elsif ( $HTML5Media_field->subfield('a') && $HTML5Media_field->subfield('d') && $HTML5Media_field->subfield('f') ) { > $HTML5Media{host} = $HTML5Media_field->subfield('a'); >@@ -108,11 +116,15 @@ sub gethtml5media { > else { > next; # no file to play > } >- # extension >+ # extension or youtube > $HTML5Media{extension} = ($HTML5Media{srcblock} =~ m/([^.]+)$/)[0]; >- if ( !grep /\Q$HTML5Media{extension}\E/, @HTML5MediaExtensions ) { >+ if ( ( !grep /\Q$HTML5Media{extension}\E/, @HTML5MediaExtensions ) && ( !grep /youtube/, $HTML5Media_field->subfield('u') ) ) { > next; # not a specified media file > } >+ # youtube >+ if ( grep /youtube/, $HTML5Media_field->subfield('u') ) { >+ $HTML5Media{mime} = 'video/webm'; >+ } > # mime > if ( $HTML5Media_field->subfield('c') ) { > $HTML5Media{codecs} = $HTML5Media_field->subfield('c'); >@@ -144,7 +156,7 @@ sub gethtml5media { > } > if ( $HTML5Media{extension} eq 'oga' ) { > $HTML5Media{mime} = 'audio/ogg'; >- $HTML5Media{codecs} = 'vorbis'; >+ $HTML5Media{codecs} = 'vorbis'; > } > elsif ( $HTML5Media{extension} eq 'spx' ) { > $HTML5Media{mime} = 'audio/ogg'; >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14168
:
45331
|
45333
|
45339
|
47327
|
47369
|
47403
|
47459
|
47460
|
48542
|
48586
|
48587
|
48637
|
48643
|
48644