Sure you can use JWPplayer! The added bonus with JWPlayer is that if you buy the Pro version you can disable right click inside the video area, which could be useful if you make a SmartTV app which includes mouse integration and it breaks on an unaffiliated pop up on screen.
- Register for an API account on Jwplayer website
- Get the JS
- Place the JS in the folder structure of your app. Possibly in the same folder of your
main.js
file - Create a div in your
index.html
namedvideoPlayerBox
, the player will be loaded in this div. Initialize the player by calling this function:
function displayVideoPlayer(url) { jwplayer('videoPlayerBox').setup({ file: url, width: '960', height: '540', events:{ onComplete: function() { jwplayer().playNextVideo(); } } });
Then to play, stop pause the player you can simply do:
jwplayer.stop()
,jwplayer.play()
and so on...