5

I'm trying to add YouKu functionality to a site, to sit alongside other videos in a gallery.

I'm using the documentation I've found at https://cloud.youku.com/docs and https://cloud.youku.com/tools (I've been relying on Google Translate as my understanding of the Chinese language is non-existent!)

This second link suggests a snippet like so:

<div id="youkuplayer" style="width:480px;height:400px"></div>
<script type="text/javascript" src="//player.youku.com/jsapi"></script>

var player = new YKU.Player('youkuplayer',{
  styleid: '0',
  client_id: 'MY_CLIENT_ID',
  vid: 'XMzA2ODI5MjAwNA==',
  newPlayer: true 
});

function pauseVideo() {
  player.pauseVideo();
}

However, the pauseVideo method doesn't work, throwing a Cannot read property 'pauseVideo' of null" error

In other docs I've found an events parameter but this isn't working for me either.

Has anyone had any experience with programmatically controlling YouKu videos?

Matthias M
  • 12,906
  • 17
  • 87
  • 116
Paul
  • 961
  • 1
  • 6
  • 20

1 Answers1

2

In case some still wonder, Youku API seems to be not responding right. For hours I tried implementing player.playVideo and player.pauseVideo in various ways, made sure the video is fully loaded, but the same error as OP mentions. Events work fine, but not methods.

Then I found this post: https://www.codeseek.co/raghavd17/youku-video-player-control-eZWbBK

And it seems like at one point in time, this code worked, but it doesn't anymore. Knowing how not helpful Youku support is (we were locked out out of our account, and nobody got back to us for days) I can only guess that those guys are not very caring.

Nookeen
  • 445
  • 4
  • 7