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?