1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+ < head >
4
+ < meta charset ="utf-8 " />
5
+ < meta http-equiv ="X-UA-Compatible " content ="IE=edge,chrome=1 "/>
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no " />
7
+ < title > Sewise M3U8 src方式嵌入播放</ title >
8
+ < style type ="text/css ">
9
+ body {
10
+ margin : 0px ;
11
+ padding : 0px ;
12
+ }
13
+ </ style >
14
+ < script src ="http://code.jquery.com/jquery-1.11.1.min.js "> </ script >
15
+ </ head >
16
+ < body >
17
+ < div style ="width: 700px; height: 300px; ">
18
+ < script type ="text/javascript " src ="http://jackzhang1204.github.io/sewise/sewise_player/player/sewise.player.min.js "> </ script >
19
+ < script type ="text/javascript ">
20
+ var letvURL = "http://cdn1.amailive.com/hls/001.m3u8" ;
21
+ var youkuURL = "http://cdn1.amailive.com/hls/002.m3u8" ;
22
+ var letvTitle = "播放001 M3U8" ;
23
+ var youkuTitle = "播放002 M3U8" ;
24
+ SewisePlayer . setup ( {
25
+ server : "vod" ,
26
+ type : "m3u8" ,
27
+ videourl : letvURL ,
28
+ skin : "vodWhite" ,
29
+ claritybutton : "disable" ,
30
+ title : letvTitle ,
31
+ lang : 'zh_CN'
32
+ } ) ;
33
+ $ ( document ) . ready ( function ( ) {
34
+ $ ( "#switch" ) . text ( youkuTitle ) ;
35
+ $ ( "#switch" ) . click ( function ( e ) {
36
+ if ( $ ( "#switch" ) . text ( ) == youkuTitle ) {
37
+ SewisePlayer . toPlay ( youkuURL , youkuTitle , 0 , true ) ;
38
+ $ ( "#switch" ) . text ( letvTitle ) ;
39
+ } else {
40
+ SewisePlayer . toPlay ( letvURL , letvTitle , 0 , true ) ;
41
+ $ ( "#switch" ) . text ( youkuTitle ) ;
42
+ }
43
+ } ) ;
44
+ } ) ;
45
+ </ script >
46
+ </ div >
47
+ < div style ="padding: 20px; "> < button id ="switch " style ="width: 120px; height: 30px; "> </ button > </ div >
48
+ < div style ="padding: 10px;float: left; "> 注:如果当前设备为Mobile平台,播放器将自动启用HTML5播放模块播放m3u8文件。</ div >
49
+ </ body >
50
+ </ html >
0 commit comments