Page 1 of 1

Youtube video don't stop

PostPosted: Wed Jul 09, 2014 4:43 am
by arainziliel_1
I'm doing an application that plays youtube videos.

It works fine but key event don't.

I have a js function that handle remote control key events:

Main.keyDown = function()
{
var keyCode = event.keyCode;

switch(keyCode)
{
case VK_PAUSE:
player.pauseVideo();
break;
case VK_PLAY:
player.playVideo();
break;
default:
break;
}
}

With onkeydown in html:



Twice are handled but calling player.stopVideo has not effect (player.playVideo has).

Please, help.
Thanks

Youtube video don't stop

PostPosted: Thu Jul 10, 2014 12:31 am
by Support_STA
Hi,

Could you make it clearly? Did you implement VK_STOP case in your keydown handle function?
In your above code, I don't see VK_STOP case in your code.
Hope this document helpful.

Regards,
STA Support

Youtube video don't stop

PostPosted: Thu Jul 10, 2014 1:25 am
by arainziliel_1
Implementig VK_STOP case:

case VK_STOP:
player.stopVideo();
break;

Doesn't work neither. Both cases, Pause and Stop video, have not effect.

I have new info. Apparently, when pause or stop video, the player return state -1.

is(status == -1) alert(\"Video has not started\");

But I wait tofunction onPlayerReady(evt) execution. What I'm doing wrong?