I need to be able to stop a JWPlayer Iframe this is the code i am using
html:
<a href="#" onclick="popup('video'); stopvideo();" >Click To Close</a>
<iframe src="<?php echo get_template_directory_uri(); ?>/scalerokuengine.php" id="rokuvideo" scrolling="no" frameBorder="0" width="960" height="470"> </iframe>
javascript:
function stopvideo() {
document.getElementById('rokuvideo').jwplayer().stop();
}
This is the code that the iframe is includeing:
<div id="se_video" width="100%" height="100%"></div>
<script type="text/javascript" src="http://barakyah.embed.scaleengine.net/latest/jwplayer.min.js"></script>
<script type="text/javascript">
jwplayer('se_video').setup({
'flashplayer': 'http://barakyah.embed.scaleengine.net/latest/jwplayer.swf',
'autostart': 'false',
'provider': 'rtmp',
'streamer': 'rtmp://channel.tvstartup.net/barakyah-vod/play/',
'file': 'sestore1/barakyah/newsystem/tvstartupvideo_Roku-Video_1446408572907.mp4',
'stretching': 'exactfit',
'modes': [
{
'type': 'flash',
'src': 'http://barakyah.embed.scaleengine.net/latest/jwplayer.swf'
},
{
'type': 'html5',
'config': {
'file': 'http://stream.tvstartup.net/barakyah-vod/play/sestore1/barakyah/newsystem/tvstartupvideo_Roku-Video_1446408572907.mp4/playlist.m3u8',
'provider': 'video'
}
}
],
'bufferlength': '5',
'width': '940',
'height': '470'
});
</script>
Thank You Guys
$("iframe").contents().find(jwplayer_element).jwplayer().stop();