12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- var xg_player=null;
- function xgPlay(htmlid,pull,stream='',data={}){
- if(xg_player){
- var par=document.getElementById(htmlid).parentNode;
- xg_player.destroy(false);
-
- par.innerHTML ='<div id="'+htmlid+'"></div>';
- }
- xg_play(htmlid,pull,stream,data);
- }
- function xgPlays(htmlid,pull,stream,data={}){
- xg_play(htmlid,pull,stream,data);
- }
- function xg_play(htmlid,pull,stream,data={}){
- if(htmlid=='' || pull==''){
- return !1;
- }
- var last_len=pull.lastIndexOf(".")+1;
- var last_len2=pull.lastIndexOf("?");
- var len = pull.length;
- if(last_len2>0){
- len=last_len2;
- }
- var pathf = pull.substring(last_len,len).toLowerCase();
-
-
- var data_play={
- "id": htmlid,
- "url": pull,
- "volume":0.2,
- "width":'100%',
- "height":'100%',
- "ignores": ['time','replay'],
- autoplay:false,
-
- };
-
- data_play= $.extend(data_play, data);
-
- if(pathf=='flv'){
-
- let xg_player = new window.FlvJsPlayer(data_play);
-
- xg_player.on('play',function(){
-
-
- })
-
- xg_player.on('pause',function(){
-
-
- })
-
- return !0;
- }else if(pathf=='m3u8'){
-
- let xg_player=new window.HlsJsPlayer(data_play);
- return !0;
- }else{
-
- let xg_player=new Player(data_play);
-
- return !0;
- }
-
-
- }
|