Moodle plugins directory: YouTube Anywhere | Moodle.org
YouTube Anywhere
YouTube Anywhere allows students and teachers to record directly from webcams and mobile devices, or to upload video files, into YouTube.
YouTube takes care of the storage of the videos and handles all the pesky file conversions and playback stuff.
Care has been taken to give the Moodle administrator control over who can access YouTube Anywhere. Authentication with YouTube can be done using the same Google keys as used in the Google Docs repository.
Requirements
* Moodle 2.4 or greater
* Internet access
* Multimedia plugins filter enabled (to turn YouTube links into YouTube players)
* YouTube API keys (Public API Key, OAUTH2 client id, OAUTH2 client secret).
These are available free of charge from YouTube/Google.
Installation
The YouTube Anywhere plugin is contained in the youtube folder. That folder should be placed in the following directory of a Moodle installation: [PATH TO MOODLE]/lib/editor/tinymce/plugins
Other folders in that directory will include, spellchecker and moodlemedia.
Once the folder is in place Moodle will be able to install the plugin. Login as the site administrator. Moodle should detect the YouTube Anywhere plugin and present a page with plugin information and the option to proceed to install a new plugin. If Moodle does not automatically direct you to this page, you can go there from the Moodle menu:
Site Administration -> Notifications
Follow the prompts to install the plugin. On the last step Moodle will show the settings page for YouTube Anywhere. The settings can be accessed by the administrator at any time from the Moodle menu:
Site Administration -> Plugins -> Text Editors->TinyMCE HTML Editor -> YouTube Anywhere
Post Installation Settings
You will need several keys to authorize access to the YouTube API.
To get this go to:
https://console.developers.google.com
You will need to create a project for your website. Only one is necessary for your Moodle site, and you can use the same keys for Google Docs or Picasa. If you are running either of those with Moodle, you can use the keys you already have. You will need to create and get:
i) a public api key
ii) an oauth2 client id
iii) an oauth2 client secret
This screenshot indicates how your API project on Google might look.
More information on getting Google OAuth2 set up for Moodle is here: https://docs.moodle.org/27/en/Google_OAuth_2.0_setup
There are two authentication methods possible, "master account" and "student account."
If using master account authentication, you will need to enter a valid YouTube username and password.
More detailed documentation can be found in a PDF file, that should accompany this plugin.
My humble vid:
https://www.youtube.com/watch?feature=player_embedded&v=E-v0wZxMjrA
I am glad you think its useful. I think it is too.
Master account authentication, allows you to set a single YouTube account for all the videos. This works, but is not the ideal method. That is because it means the account holder is responsible for the content uploaded by the students. That could lead to problems. Also there is no way to make webcam submissions use Master account authentication.
The second method, student authentication is recommended. This requires the each user to login to their own google/ account to do the recording or upload. But avoids the problems of the other method.
For anyone using it on a fully https site, note that URLs contained in a couple of files may need modifying slightly (otherwise Google Chrome will block the associated scripts from running automatically).
Here's what worked for us:
In both of the following...
/lib/editor/tinymce/plugins/youtube/youtubelib.php
/lib/editor/tinymce/plugins/youtube/tinymce/js/youtube.js
...modify the line containing a reference to "http://www.youtube.com/iframe_api" to "https://www.youtube.com/iframe_api".
Also, in the youtube.htm file, change the line referencing "http://yui.yahooapis.com/3.9.0/build/yui/yui-min.js" so it points to the equivalent .js on your https Moodle installation. For example, on Moodle 2.4.5 this would be "https://your.moodle.domain.here/lib/yuilib/3.7.3/build/yui/yui-min.js".
Chrome's javascript console will probably still report a gdata-related error when uploading a video, but it should work successfully.
NoLinkedYouTubeAccount
Error 401
I am certain I am logged into my YouTube account correctly as another tab is viewing YouTube and logged in. I am using student authentication in our site.
Why would I use this plugin over the MyTube version or does this plugin replace it?
I am not sure about that error. But I would try a few things.
1) Completely close the browser and all browser windows. Then try again. That should make sure you are logging in as you think
2) Are you using a full email address as your YouTube login. I think that is important.
3) Check that your oath and client keys are all ok.
Does that make a difference?
If possible, I wonder if I could ask for one last bit of help before we release this plugin to our users. During trials with staff, a recurring request we came across had to do with making it possible for tutors to easily embed videos which already exist on YouTube (not necessarily their own). This functionality - simply entering a URL - was present in the beta release (i.e. via the $manual option) and is available in the YouTube submission plugin also. With this in mind, I've managed to restore the manual tab via uncommenting the relevant parts of youtubelib.php, but have hit a snag when it comes to the URL then being passed into the TinyMCE window itself. Basically, the desired URL becomes prefixed with the same address that's applied to uploaded or recorded vid IDs i.e. "http://www.youtube.com/watch?v=", resulting in a broken player. I know this behaviour is controlled in /youtube/tinymce/js/youtube.js, but I just wondered if there's any easy fix for this (unfortunately, my own js skills are a bit limited)? Maybe something like an additional if statement that was able to parse manual URL entries? I do realise there are alternative approaches to doing what our tutors have in mind, but it would be really great in our eyes if YouTube Anywhere was a one-stop shop for all things YouTube-related.
If you do have any ideas you'd be willing to share, I'd be very grateful.
I left that manual submit thing in because
a) When testing it was quite useful to be able just paste a url rather than have to record something each time
b) I thought somebody might like it, someday, somewhere
So I am glad that some people do want to use it. Probably the simplest way of doing it is just to check if the length of the video id is greater then 11. If so consider it a URL and don't add the full youtube url.
A quick "hack" to do this would be to add a line in /lib/editor/tinymce/plugins/youtube/tinymce/js/youtube.js:
Around line 60, just after:
var src = "http://www.youtube.com/watch?v=";
Add this line:
if (vid.length > 11){src ="";}
Next release of the plugin I will add switches and stuff to enable the manual tab.
It's plugins like this and developers like yourself that make Moodle so valuable, imo - so a big thanks for sharing your work with us!