-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" /> | ||
<title>Sewise M3U8 src方式嵌入播放</title> | ||
<style type="text/css"> | ||
body{ | ||
margin: 0px; | ||
padding: 0px; | ||
} | ||
</style> | ||
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | ||
</head> | ||
<body> | ||
<div style="width: 700px; height: 300px; "> | ||
<script type="text/javascript" src="http://jackzhang1204.github.io/sewise/sewise_player/player/sewise.player.min.js"></script> | ||
<script type="text/javascript"> | ||
var letvURL = "http://cdn1.amailive.com/hls/001.m3u8"; | ||
var youkuURL = "http://cdn1.amailive.com/hls/002.m3u8"; | ||
var letvTitle = "播放001 M3U8"; | ||
var youkuTitle = "播放002 M3U8"; | ||
SewisePlayer.setup({ | ||
server: "vod", | ||
type: "m3u8", | ||
videourl: letvURL, | ||
skin: "vodWhite", | ||
claritybutton: "disable", | ||
title: letvTitle, | ||
lang: 'zh_CN' | ||
}); | ||
$(document).ready(function(){ | ||
$("#switch").text(youkuTitle); | ||
$("#switch").click(function(e){ | ||
if($("#switch").text() == youkuTitle){ | ||
SewisePlayer.toPlay(youkuURL, youkuTitle, 0, true); | ||
$("#switch").text(letvTitle); | ||
}else{ | ||
SewisePlayer.toPlay(letvURL, letvTitle, 0, true); | ||
$("#switch").text(youkuTitle); | ||
} | ||
}); | ||
}); | ||
</script> | ||
</div> | ||
<div style="padding: 20px;"><button id="switch" style="width: 120px; height: 30px; "></button></div> | ||
<div style="padding: 10px;float: left;">注:如果当前设备为Mobile平台,播放器将自动启用HTML5播放模块播放m3u8文件。</div> | ||
</body> | ||
</html> |