Youtube Singleton

The YouTube.get method will return you a object that can be directly passed to a MAF.media.PlaylistEntry Class

Youtube()

Example

YouTube.get('https://www.youtube.com/watch?v=9__EAOddo74', function(config) {
    MAF.mediaplayer.playlist.set((new MAF.media.Playlist()).addEntry(new MAF.media.PlaylistEntry(config)));
    MAF.mediaplayer.playlist.start();
 });

Methods

get(id, callback, scope)

This will fetch info about a youtube video.

Parameters:

NameTypeArgumentDescription
idString

Youtube video id or youtube url.

callbackfunction

The method that will be triggered when the info about the video is available.

scopeObjectoptional 

Define the scope if you want the callback to be run in a specific scope.

regionQueryString()