YouTube Anywhere

TinyMCE (legacy) ::: tinymce_youtube
Maintained by Justin Hunt
YouTube Anywhere enables direct recording and uploading into YouTube from the TinyMCE HTML editor.
Latest release:
31 sites
5 downloads
17 fans
Current versions available: 1

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.

Google Developers Console

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.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2

Contributors

Justin Hunt (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • MD shot of me from his iphone4
    Mon, 20 May 2013, 12:43 PM
    Thanks for sharing this!
  • Frankie's the name, Moodle's my game!
    Sat, 1 Jun 2013, 11:08 AM
    Fantastic! I just made a recording and I realise how useful this is. Took me about an hour to setup everything including my mic and webcam and now... this has like totally ramped up the functionality of my Moodle site.
    My humble vid:
    https://www.youtube.com/watch?feature=player_embedded&v=E-v0wZxMjrA
  • Justin Hunt
    Sun, 2 Jun 2013, 10:44 PM
    Thanks Frankie. Nothing humble about that video!

    I am glad you think its useful. I think it is too.
  • This is me.  Deal with it!
    Mon, 3 Jun 2013, 10:39 PM
    So my one question is where does the video live on youtube? Does it go into each users own youtube account or do you need to set up an institution account where they all get sent to?
  • Justin Hunt
    Tue, 4 Jun 2013, 4:51 AM
    Kieran, either method is possible. If using master account auth all videos are stored in that account. If using student account auth, each student's videos are stored in their own account.

    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.
  • Mumin Al-Shawaf
    Thu, 20 Jun 2013, 11:20 PM
    I am running 2.2 .. Will this work on it?
  • Justin Hunt
    Thu, 20 Jun 2013, 11:34 PM
    No, it requires Moodle 2.4. Try the MyTube repository that will do the same thing, albeit via the repository system. http://poodll.com/mytube-repository/
  • Roland Sherwood
    Fri, 9 Aug 2013, 6:04 PM
    Thanks again for this great plugin Justin.

    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.
  • Justin Hunt
    Fri, 9 Aug 2013, 7:03 PM
    Wonderful. Thanks Roland. I bet I can find a way to do all this within the plugin itself so people don't need to modify the files themselves. I struggled to find a way to get the YUI path at runtime, and I fudged and accessed the online ones. But I see that is a problem here.
  • Leon hedding
    Wed, 14 Aug 2013, 8:12 PM
    Justin, I am getting the following error when I try to insert a YouTube video into my post.

    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?
  • Justin Hunt
    Thu, 15 Aug 2013, 8:48 AM
    This and the Mytube repository do bascially the same thing. The YouTube Anywhere plugin requires fewer clicks to get it all done, and is easier to explain. But only works on 2.4 and above.
    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?
  • Roland Sherwood
    Mon, 19 Aug 2013, 11:38 PM
    Hi again Justin. Yes - if the plugin was somehow able to detect when https was in use I'm sure it would be useful for some; but please don't be too hard on yourself - what you've put together is still hugely impressive!

    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.
  • Justin Hunt
    Tue, 20 Aug 2013, 11:03 AM
    Hi Roland

    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.
  • Roland Sherwood
    Fri, 6 Sep 2013, 6:50 PM
    Hi again Justin. Apologies for the belated reply - the new term has kicked off here and it's been a little hectic these last few weeks...! Just to say, again, many thanks for all your help with my queries - especially with enabling the URL tab. This was the missing piece of the puzzle for us and staff are now happy to be able to embed videos so easily.

    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!
Please login to post comments