问题
I am trying to use javascript to pause, jump to position, and adjust volume in netflix's silverlight player.
There is no published API document for it in netflix, but I am guessing there is some silverlight controls buried in the app that are accessible via javascript.
回答1:
Partialy it can be done, but its awkward. The Silverlight plugin can be controlled by key strokes, once it has focus.
You might find elsewhere what are to combinations. Basicly there is space for pause/play, arrows for rewinding and ctrl arrows for some other kind of rewinding.
Could be tricky to know, when Silverlight has focus. Usualy you have to emulate click on it.
I never accomplished volume manipulation. Cheers!
回答2:
You need to locate video element on page. Here is some samples
//start playing
$('video').play();
//stop playing
$('video').stop();
Handle event of play start
$('video').addEventListener('playing',function(){
console.log('video is playing');
}
);
来源:https://stackoverflow.com/questions/9195337/use-javascript-to-pause-jump-to-position-and-adjust-volume-in-netflixs-silver