javascript - JS write HTML <video class"afterglow"> and Link a class -


i have problems project have js file boostrap modal popu.p , printing html5 videoplayer ... problem cannot link class videoplayer theme. can guys me find problem or solution?

html

<script type="text/javascript" src="js/afterglow.min.js"></script> <script type="text/javascript" src="js/jwplayer/jwplayer.js"></script> <script type="text/javascript" src="js/map.initialize.js"></script> 

js script

var video_wpp = null; var video = null; var format = ""; if(obj.filme == undefined || obj.filme == null){     video_wpp = $("<div class='not_available'>video not available!</div>"); } else{     if(obj.filme.indexof(".flv") > -1)     {         video_wpp = $("<div class='flv-video'></div>");         video_wpp.attr("id", "flv_"+obj.id);         format = "flv";     }     else if(obj.filme.indexof(".mp4") > -1)     {          video_wpp = $("<div class='mp4-video'></div>");         video_wpp.css({             width: "100%"         });           video = $('<video controls class="afterglow" oncontextmenu="javascript:return false;" id="myvideo" data-skin="dark" data-autoclose="true">');           var src = $('<source src="movie.mp4" type="video/mp4"></video>');         src.attr("src", obj.filme);         src.attr("type", "video/mp4");          video.append(src);         video_wpp.append(video);         format = "mp4";     } } 

the jwplayer works links class , bring player , afterglow dosent link why? shows standard white html videoplayer

after adding video element dynamically, afterglow needs initialized using afterglow.init(). happen automatically when domcontentload event triggered has done manually when adding videos after domcontentloaded event.

as using jquery, assume code bound event afterglow (which default way work jquery), you'll need apply again (f.i. after video_wpp.append(video);.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -