Reputation: 30303
In my web application, i place the jw player for playing the video file. it is not working in fire fox an google chrome. it is working in IE
dvplayer.InnerHtml = "<object id='player' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' name='player' width='500' height='300' > <param name='movie' value='player.swf' /> <param name='allowfullscreen' value='true' /> <param name='allowscriptaccess' value='always' /> <param name='flashvars' value='file=" + file + "&autostart=true' /> </object>";
Upvotes: 0
Views: 5016
Reputation: 16624
I wrote a small test that is working in Chrome and Firefox:
<div id="mediaplayer">JW Player goes here</div>
<script type="text/javascript">
var file = "video.mp4";
document.getElementById('mediaplayer').innerHTML = '<object type="application/x-shockwave-flash" data="player.swf" width="100%" height="100%" bgcolor="#000000" id="mediaplayer" name="mediaplayer" tabindex="0"><param name="allowfullscreen" value="true"><param name="allowscriptaccess" value="always"><param name="seamlesstabbing" value="true"><param name="wmode" value="opaque"><param name="flashvars" value="netstreambasepath=file%3A%2F%2F%2Fhome%2Faeby%2Fworkspace%2Fatws%2Ftest.html&id=mediaplayer&file=' + file + '&image=preview.jpg&controlbar.position=over"></object>';
</script>
One mistake is that InnerHtml
is not lower case. It should read dvplayer.innerHtml
.
Upvotes: 2