How to play video from youku using javascript ?
I tried to do like this but not work, how can i do that ?
<iframe id="test" src="https://player.youku.com/embed/XMjUzMzY2ODQ4OA==" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" style="position: absolute; top: 0; left: 0; width: 50%; height: 50%;"></iframe>
<div style=" position: fixed; top: 56%; " onclick="play_fn()">Play</div>
<script>
function play_fn(){
var test = document.getElementById('test');
test.play();
}
</script>
Check my solution. You can figure out the styles for your own case, I'm using the
span
as overlay above the video and when you click on it, it disappears and the video plays.