Would be nice if you could catalog youtube videos and have them steam in Koha like you can other HTML5 videos. We might be able to use something like https://metacpan.org/pod/WWW::YouTube::Download for this
an idea from drojf: soething like this http://www.htmlgoodies.com/imagesvr_ce/9722/youtube3.jpg and if you catalogue the url part, the rest around it could be generated. still a new feature though
I have a prototype that uses https://metacpan.org/pod/WWW::YouTube::Download to resolve the webm video link on the fly from a regular youtube link catalogued in 856$u. I will upload it when I had some more time for testing. Two things: - WWW::YouTube::Download is packaged for Debian Jessie, but not Wheezy. It depends on libxml-treepp-perl which is available on both systems. Have not checked Ubuntu. Probably have to ask Robin what to do about that. I rolled a package for Wheezy to test, I will upload it or link to it so the patch can be tested. - I have no idea if this is compliant to Youtube TOS. It does the same thing as your browser would if you opened the Youtube link: check for the file in a desired format and then play it. Link is generated on the fly, nothing is downloaded and stored anwhere on the Koha server. The video file is sent directly to the person opening the record.
Any luck getting this turned in to a patch?
Created attachment 45331 [details] [review] Bug 14168 - enhance streaming cataloging to include youtube Initial commit. POCish.
Created attachment 45333 [details] [review] Bug 14168 PerlDependencies
Needs libwww-youtube-download-perl to work, which is in Jessie. https://packages.debian.org/jessie/libwww-youtube-download-perl Hardcoded video format: WEBM. Todo: - scans only for /youtube/ in the URL, should also know relevant URL shorteners - syspref (youtube yes/no?) - probably more :)
todo - add dependency to debian/contol
Created attachment 45339 [details] [review] Bug 14168 - enhance streaming cataloging to include youtube Add optional embedding of YouTube videos via HTML5Media. New syspref: HTML5MediaYouTube: Embed/Don't embed videos. Format WEBM is hardcoded as it is the only format accepted by all modern browsers. Test plan: - apply patch - catalogue a YouTube link in 856$u - turn on HTML5MediaEnabled and HTML5MediaYouTube - open the record in OPAC and staff client, check that the 'Play media' tab is showing and playing the video works. Possible enhancements for followups: - check available formats, offer quality choice - accept official YT URL shortener
I forgot to say that the following still applies: Needs libwww-youtube-download-perl to work, which is in Jessie. https://packages.debian.org/jessie/libwww-youtube-download-perl Install it before testing :) The Jessie module will likely work in Wheezy too.
Applying: Bug 14168 - enhance streaming cataloging to include youtube /home/vagrant/kohaclone/.git/rebase-apply/patch:47: trailing whitespace. $HTML5Media_field->subfield('u'), { warning: 1 line adds whitespace errors. Using index info to reconstruct a base tree... <stdin>:47: trailing whitespace. $HTML5Media_field->subfield('u'), { warning: 1 line applied after fixing whitespace errors. Falling back to patching base and 3-way merge... Auto-merging installer/data/mysql/sysprefs.sql Auto-merging C4/Installer/PerlDependencies.pm CONFLICT (content): Merge conflict in C4/Installer/PerlDependencies.pm Auto-merging C4/HTML5Media.pm CONFLICT (content): Merge conflict in C4/HTML5Media.pm Failed to merge in the changes.
Created attachment 47327 [details] [review] Bug 14168 - enhance streaming cataloging to include youtube Add optional embedding of YouTube videos via HTML5Media. New syspref: HTML5MediaYouTube: Embed/Don't embed videos. Format WEBM is hardcoded as it is the only format accepted by all modern browsers. Test plan: - apply patch - catalogue a YouTube link in 856$u - turn on HTML5MediaEnabled and HTML5MediaYouTube - open the record in OPAC and staff client, check that the 'Play media' tab is showing and playing the video works. Possible enhancements for followups: - check available formats, offer quality choice - accept official YT URL shortener
Aleisha, thanks for testing! I rebased the patch.
Hi Mirko, patch applied fine but I got a software error while going on to a biblio detail page (ie catalogue/detail.pl). Can't locate WWW/YouTube/Download.pm in @INC (@INC contains: /home/vagrant/kohaclone /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /home/vagrant/kohaclone/C4/HTML5Media.pm line 26. BEGIN failed--compilation aborted at /home/vagrant/kohaclone/C4/HTML5Media.pm line 26. Compilation failed in require at /home/vagrant/kohaclone/catalogue/detail.pl line 42. BEGIN failed--compilation aborted at /home/vagrant/kohaclone/catalogue/detail.pl line 42.
Aleisha, please see comment 9 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14168#c9 You need to have the package libwww-youtube-download-perl installed.
Created attachment 47369 [details] [review] [SIGNED-OFF] Bug 14168 - enhance streaming cataloging to include youtube Add optional embedding of YouTube videos via HTML5Media. New syspref: HTML5MediaYouTube: Embed/Don't embed videos. Format WEBM is hardcoded as it is the only format accepted by all modern browsers. Test plan: - apply patch - catalogue a YouTube link in 856$u - turn on HTML5MediaEnabled and HTML5MediaYouTube - open the record in OPAC and staff client, check that the 'Play media' tab is showing and playing the video works. Possible enhancements for followups: - check available formats, offer quality choice - accept official YT URL shortener Signed-off-by: Aleisha <aleishaamohia@hotmail.com> Works perfectly!
Created attachment 47403 [details] [review] [SIGNED-OFF] Bug 14168 - enhance streaming cataloging to include youtube Add optional embedding of YouTube videos via HTML5Media. New syspref: HTML5MediaYouTube: Embed/Don't embed videos. Format WEBM is hardcoded as it is the only format accepted by all modern browsers. Test plan: - apply patch - catalogue a YouTube link in 856$u - turn on HTML5MediaEnabled and HTML5MediaYouTube - open the record in OPAC and staff client, check that the 'Play media' tab is showing and playing the video works. Possible enhancements for followups: - check available formats, offer quality choice - accept official YT URL shortener Signed-off-by: Aleisha <aleishaamohia@hotmail.com> Works perfectly! Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com> I love it!!!
Created attachment 47459 [details] [review] Bug 14168 - enhance streaming cataloging to include youtube Add optional embedding of YouTube videos via HTML5Media. New syspref: HTML5MediaYouTube: Embed/Don't embed videos. Format WEBM is hardcoded as it is the only format accepted by all modern browsers. Test plan: - apply patch - catalogue a YouTube link in 856$u - turn on HTML5MediaEnabled and HTML5MediaYouTube - open the record in OPAC and staff client, check that the 'Play media' tab is showing and playing the video works. Possible enhancements for followups: - check available formats, offer quality choice - accept official YT URL shortener Signed-off-by: Aleisha <aleishaamohia@hotmail.com> Works perfectly! Signed-off-by: Nicole C Engard <nengard@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 47460 [details] [review] Bug 14168 [QA Followup] - Fix typo Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Pushed to Master - Should be in the May 2016 release. Thanks!
Created attachment 48542 [details] [review] Bug 14168 - Followup: make module WWW::YouTube::Download required Module C4::HTML5Media is used in detail.pl, so if you don't have installled module for YouTube, you get an internal server error. This patch make module WWW::YouTube::Download required and adds it to package dependencies Test plan: 1. Don't have installed module WWW::YouTube:Download, neither package libwww-youtube-download-perl 2. Try to access biblio detail in staff client (detail.pl) - you'll be presented withh internal server error 3. Check the About page -> Perl modules, the WWW::YouTube::Download should be reported as missing optional 4. Apply the patch 5. Check the About page -> Perl modules, the WWW::YouTube::Download should now be reported as missing required 6. Create and install debian package, the libwww-youtube-download-perl should be the dependency and so installed with koha-common package (use apt-get install -f, if neccessery) 7. Check the About page -> Perl modules, the WWW::YouTube::Download should now be reported as Module current 8. Try to access biblio detail in staff client (detail.pl) - it should be display, no error now
Just marking that last patch - as not obsolete until we've got another patch that does what we need.
Héctor moved the patch to newly created bug 15964, that's propably the reason of obsoleting my followup here.
Created attachment 48586 [details] [review] Bug 14168 Follow-up: require WWW::YouTube::Download only when syspref enabled This patch fixes the problem of missing WWW::YouTube::Download breaking record detail views. Instead of a general 'use', the module is only required if the related syspref is enabled.
I added a followup. Expected results: - without libwww-youtube-download-perl -- HTML5MediaYouTube disabled: detail views work fine -- HTML5MediaYouTube enabled: detail views throw an error ('Can't locate WWW/YouTube/Download.pm in @INC …') - with libwww-youtube-download-perl -- HTML5MediaYouTube disabled: detail views work fine -- HTML5MediaYouTube enabled: detail views work fine and YT video works I can't switch this back to needs signoff for some reason.
Created attachment 48587 [details] [review] Bug 14168 Follow-up: require WWW::YouTube::Download only when syspref enabled This patch fixes the problem of missing WWW::YouTube::Download breaking record detail views. Instead of a general 'use', the module is only required if the related syspref is enabled.
New pref not added by the update DB process, please fix asap.
Created attachment 48637 [details] [review] Bug 14168 Followup: Atomic update for syspref
Created attachment 48643 [details] [review] Bug 14168: (followup) require WWW::YouTube::Download only when syspref enabled This patch fixes the problem of missing WWW::YouTube::Download breaking record detail views. Instead of a general 'use', the module is only required if the related syspref is enabled. Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com>
Created attachment 48644 [details] [review] Bug 14168: (followup) atomic update for syspref Signed-off-by: Jesse Weaver <jweaver@bywatersolutions.com> Fixed small typo (extra ').
Ok I should be caught up on this one now. Please let me know if I did something screwy or missed something. Thanks much
*** Bug 15964 has been marked as a duplicate of this bug. ***