Embed.ly API: player.js not working with youku.com

782 Views Asked by At

I have a problem with embedded video. I use "Embed.ly API" and "player.js": https://docs.embed.ly/docs/oembed

https://docs.embed.ly/docs/playerjs

I'm trying to embed a video from "youku.com" on my site. The "youku.com" is a content provider, as stated here: https://embed.ly/providers Video is added but player's methods (play, pause and others) does not work for video. But if I changing video service from "youku.com" to "youtube.com" and use video from "youtube.com", then methods works well.

I also tried to connect the "platform.js" instead of the player. The result is the same. Maybe the "player.js" worked before, I guess that the "youku.com" has changed its API, but the "player.js" did not track changes.

Does the player.js really work with "youku.com" now? Perhaps something should be added to my code for solve the problem? I am not in China, can it have any effect due to the fact that "youku.com" is a Chinese service?

Thanks.

My code js: (And another question: are there any errors in the code?)

      var obj_json = $.getJSON('https://api.embedly.com/1/oembed?' + $.param({
    url: :url,  // for example:  https://v.youku.com/v_show/id_XMzg2MjgwNzA0OA==.html 
    key: :key  // my_API_key
  })).done(function () {
    $('.embeded').html(obj_json.responseJSON.html).find('iframe.embedly-embed').each(function () {

      // initialize the player.
      var player = new playerjs.Player(this);

      player.on('ready', function () {
        player.setLoop(true); // it is not work 
        player.play(); // it is not work 
        //..................................
        //  There are also special buttons on the page, clicking on which the video should start or stop:
       $('.button_play').click(function () { 
            player.play();  // pressing occurs, but player it is not work 
        });
        $('.button_pause').click(function () { 
            player.pause();  // pressing occurs, but player it is not work 
        });
        //.........................................
      });
     });
    });
0

There are 0 best solutions below