Answer the question
In order to leave comments, you need to log in
Need a wrapper for a video player on a video hosting site. Is there a ready solution?
The essence of the task: you need to make a single player style on the site for videos from video hosting YouTube, Vimeo, Vk, Coub, Vine.
Has anyone written something similar?
Whether there are ready decisions?
Advise the algorithm for completing the task?
I looked towards video.js but there is a working wrapper only on youtube.
Answer the question
In order to leave comments, you need to log in
YouTube has API
C VK, you have to parse the video page and take the link to the video with all the other video hostings in about the same way ..
Xs did a project for VK for a long time and then abandoned it ...
/**
* @param _url
*/
public function getVideoUrl(url:String):void
{
this.loader = new URLLoader;
this.loader.addEventListener(Event.COMPLETE, this.getVideoUrlComplite);
this.loader.load(new URLRequest(url));
}
/**
*
* @param e
*/
private function getVideoUrlComplite(e:Event):void
{
var page:String = e.target.data;
var finder:RegExp = /name=\"flashvars\"\s+value=\"(?P<flashvars>.*)\"/gi
var result:Array = finder.exec(page);
page = null;
var flashvars:String = (result.flashvars || "").replace(/\&\;/gi, '&');
var varUrl:URLVariables = new URLVariables(flashvars);
this._url = varUrl.url360;
// url240
// url360
// url480
// url720
this._ready = true;
this.ns.play(this._url);
this.loader.removeEventListener(Event.COMPLETE, this.getVideoUrlComplite);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question