0

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 
        });
        //.........................................
      });
     });
    });
  • Any errors if you use the F12 tools in the browser? – Jeroen Heier Oct 31 '18 at 04:57
  • No errors. Only warnings. – aristov_andrey_omsk Oct 31 '18 at 05:21
  • Warnings: 1) [Deprecation] Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. 2) Midi access has been blocked because of a Feature Policy applied to the current document. 3) [Deprecation] The deviceorientation event is deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. 4) The deviceorientation events are blocked by feature policy. – aristov_andrey_omsk Oct 31 '18 at 06:28
  • Warnings next: 5) Mixed Content: The page at https:// player.youku.com/embed/..... was loaded over HTTPS, but requested an insecure image http:// r4.ykimg.com/051000005B7F6CD5AD8F6D0D8106694B This content should also be served over HTTPS. 6) Mixed Content: The page at https:// player.youku.com/embed/....... was loaded over HTTPS, but requested an insecure video http:// vali.cp31.ott.cibntv.net/......... This content should also be served over HTTPS. – aristov_andrey_omsk Oct 31 '18 at 06:33

0 Answers0