Share a jQuery-based video playback plug-in.
I recently wrote a function for online video playback. I feel this plug-in is okay. I 'd like to share it with you!
Copy codeThe Code is as follows:
<Div class = "report" id = "play-product" style = "cursor: pointer" data-flv = "video path address"> </div>
<Script type = "text/javascript">
// Play the video
$ ('# Play-product'). click (function (){
Var flvUrl = $ (this). attr ('data-flv ');
Var Close = 'closeplayer ';
Var box = 'playerbox ';
Var objclose = "#" + Close;
Var objBox = "#" + box;
$ ("Body "). append ("<div id =" + box + "> <div class = 'closetitle'> <a href = 'javascript :; 'id = "+ Close +"> click Close </a> </div> <object classid = 'clsid: d27cdb6e-ae6d-11cf-96b8-444553540000 'width = '000000' height = '000000' id = 'index' align = 'middle'> <param name = 'movi' value = '/club/images/flvPlayer.swf'> <param name = 'quality' value = 'high'> <param name = 'bgcolor' value = '# 000'> <param name = 'play' value = 'true'> <param name = 'logging' v Alue = 'true'> <param name = 'wmode' value = 'transparent'> <param name = 'Scale' value = 'show'> <param name = 'menu 'value = 'true'> <param name = 'devicefont 'value = 'false'> <param name = 'salign 'value = ''> <param name = 'flashvars' value =' flvURL = "+ flvUrl +" '> <param name = 'allowScriptAccess' value = 'sample'> <param name = 'allowfullscreen' value = 'true'> <! -- [If! IE]> --> <object type = 'application/x-shockwave-flash' data = '/club/images/flvPlayer.swf 'width = '000000' height = '000000' align = & apos; middle & apos; value & apos; & AP' bgcolor 'value = '# 000'> <param name = 'play' value = 'true'> <param name = 'loop' value = 'true'> <param name =' wmode 'value = 'transparent'> <param name = 'Scale' value = 'showall'> <param n Ame = 'menu 'value = 'true'> <param name = 'devicefont 'value = 'false'> <param name = 'salign 'value = ''> <param name = 'allowfullscreen' value = 'true'> <param name = 'flashvars' value = 'flvurl = "+ flvURL +" '> <param name = 'allowScriptAccess' value = 'sample'> <! -- <! [Endif] --> <a href = 'HTTP: // www.adobe.com/go/getflash'> </a> <! -- [If! IE]> --> </object> <! -- <! [Endif] --> </object> </div> ");
$ (Objclose). click (function (){
$ (ObjBox). remove ();
});
Return false;
});
</Script>
Js jquery video playback plug-in
Html provides an element tag for online playback. You do not need to load any plug-in or player. It is called by the element tag.
For details, go to w3school's html. If html5 is supported, it is more convenient.
Jquery Video Player Plugin
It should be a swf player or html5 player.