In CVS of Moodle 1.9.9 … a new filter for Youtube! PDF Print E-mail
User Rating: / 0
PoorBest 
Written by Ken Task   
Monday, 09 August 2010 10:52
AddThis Social Bookmark Button
Food for thought: IF the ISD allows the Moodle server a by-pass to YouTube your ISD can view YouTube content without the fear of finding some inappropriate content via YouTube.

This filter does NOT provide the 'related videos' scroller at the bottom of the player as in default embedded links.

Because the FULL URL to the resource is required in the filter tags, students may not be able to access as there might not be a bypass for students in the filtering system.  Many Teachers, however, might have a 'override'.  Since Moodle tracks, there is accountability - ie, Moodle will log user action in creating the YouTube link.

Does require some additional supports be installed.  (easy to do on Ubuntu or CentOS, BTW)

See it in action:
http://moodle.tcea.org/bisdmoodle/
(right on the front page)

From the CVS 'readme':

-- Youtube filter 1.0 --
-- original code by Adam Schechter June 2009 --
-- Designed under Moodle 1.9.5 --
-- PHP version 5.1.6 --

1. Introduction

The youtube filter uses a custom delimiting tag inserted anywhere within the text of a resource to embed and display an embedded youtube player
without having to paste the embed code into the HTML of the page. It is also designed to ignore youtube links placed in standard tags.

2. Dependencies/Installation

To run the youtube filter, your system might need some new stuff:
- php-devel (libraries that have phpize)
- pecl-http (for HTTP GET call out to youtube API - use 'pecl install' command)
- simplexml (PHP module)
- gcc (or any other C-compiler)

I was alerted to the following how-to for installing PEAR and pecl libraries,
and I'll outline the steps here briefly. The URL has more details. My commands
are for CentOS/Red Hat linux; the how-to website uses Ubuntu; your commands
might be slightly different.

URL:
http://www.markfosteronline.com/2009/01/04/how-to-install-a-php-pecl-extensionmodule-on-ubuntu/

1. Install PEAR using your favorite package manager (I use yum, and sudo/root
access will be required):
sudo yum install php-pear

2. Install the PHP development packages. There's some stuff in there that will
make things run behind the scenes:
sudo yum install php-devel

3. Install the libcurl development package:
sudo yum install curl-devel

4. Install the pecl_http extension:
sudo pecl install pecl_http

5. Add the following to your php.ini file (/etc/php.ini in CentOS/Red Hat), in the Dynamic Extensions section:
extension=http.so

6. Finally, restart apache to load the extension:
sudo /etc/init.d/httpd restart

Now, copy the entire youtubefilter folder into moodle/filter/ and you should
be right as rain.


3. Usage

- Enable the filter from the administration menu in Moodle: Modules->Filters->Manage filters
- There are 3 available sizes for the embed window, on the filter settings
page.
- To embed the youtube video, enclose the video URL in [youtube] tags. Note that there is no closing tag ([/youtube]) - simply use the regular tag again.
- Videos that cannot be embedded will display with an error message and a standard html link to the video on youtube.
- Youtube links placed placed inside of tags are designed to display normally as HTML.
- The filter does its best to strip out additional php GET parameters
Ex: anything after the video ID root in the URL, starting with the first '&': http://www.youtube.com/watch?v=ahuduPpZJQA(-->)&feature=featured)
- Multiple links can be placed within a page.

Examples:
- RIGHT:
-- This is some text of a page.[youtube]http://www.youtube.com/watch?v=zs2XiyLYJOo[youtube] This is some more text in a page.
-- This is some text that has a non-embedable video. [youtube]http://www.youtube.com/watch?v=ahuduPpZJQA&feature=featured[youtube]
-- This is some text of a page.This video will show up as a standard html link. This is some more text in a page.

- WRONG:
-- This is some text of a page.[youtube]http://www.youtube.com/watch?v=zs2XiyLYJOo[/youtube] This is some more text in a page.
-- This is some text of a page. http://www.youtube.com/watch?v=zs2XiyLYJOo This is some more text in a page.

- Advanced quirk: A youtube url that is placed in a resource that is the only text on the page will display, but will not if any other text or HTML on the page exists.
Last Updated on Monday, 09 August 2010 11:11
 
 
Total Views: 654