M
M
Maxim Devda2016-06-02 19:31:55
JavaScript
Maxim Devda, 2016-06-02 19:31:55

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

3 answer(s)
A
Alexander N++, 2016-06-03
@sanchezzzhak

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(/\&amp\;/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);
    }

E
Eugene, 2016-06-03
@Eugeny1987

Uppod can do it

L
Laid, 2016-06-11
@stoik_kpd

spruto.com
If not everything you need can do, then a lot

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question