php - JW Player not working in Chrome -
iam using jw player in website play youtube videos. have used embed code that. working in browsers when executing file local diretory. not working in google chrome when executing file server. below code.
<embed id="ply" height="384" width="430" flashvars="autostart=true&repeat=always&file=http:/www.youtube.com/watch?v=cnbfihpwthm&screencolor=000000&backcolor=000000&frontcolor=ffffff&skin=http://www.creatingafamily.org/modules/mod_jwmedia/skins/snel.swf" wmode="transparent" allowscriptaccess="always" allowfullscreen="true" quality="high" bgcolor="#000000" name="ply" style="" src="http://www.creatingafamily.org/modules/mod_jwmedia/player.swf" type="application/x-shockwave-flash"/>
please achieve this. in advance.
first of , should let jwplayer's javascript build html code.
initilaize jwplayer js, , use html5 video in html this:
<center> <video controls="controls" id="container" poster="http://www.example.com/yourvideothumbs/videothumb.jpg" width="693" height="388"> <source src="http://www.example.com/videos/jourvideo.mp4" type="video/mp4" /> </video> </center>
javascript:
if(navigator.useragent.tolowercase().match(/(android)/) || navigator.useragent.tolowercase().match(/(chrom)/) ){ //wee must force flash video player in chrome, because mp4 video files not supported yet in chrome's html5 video implementation. modes = [{type: 'flash', src: '[jwplayerbasedir]/swf/player.swf'}]; }else{ modes = [ {type: 'html5'},{type: 'flash', src: '[jwplayerbasedir]swf/player.swf'}]; } jwplayer("container").setup({ 'modes':modes, });
this worked me in browsers. jwplayer can conform if html5 supported or not.
or below forced html4 implementation:
<div id="container"></div> <script type="text/javascript"> jwplayer("container").setup({ modes = [{type: 'flash', src: '[jwplayerbasedir]/swf/player.swf'}], //force flashplayer video image: "yourvideothumbs/videothumb.jpg", //poster image file: "videos/jourvideo.mp4", //video file height: "693", //set height in px width: "388" //set width in px });
and in setup can set skin
, controls
, autostart
want: http://www.longtailvideo.com/support/jw-player/28839/embedding-the-player/
Comments
Post a Comment