日期:2014-05-17  浏览次数:21105 次

m3u8在windows上预览

<html>
<head>

    <script type="text/javascript" src="jwplayer.js"></script>
    <title>Provider tests</title>
    <style>
        body { padding: 50px; font: 13px/20px Arial; background: #EEE; }
        form { margin-top: 20px; }
        #player { -webkit-box-shadow: 0 0 5px #999; background: #000; }
        ul { margin-top: 40px; padding: 0 0 0 20px; list-style-type: square; }
    </style>

</head>
<body>



    <div id="player">You need Flash to play these tests</div>

    <script type="text/javascript">
    	jwplayer("player").setup({
			//autostart: true,
			//controlbar: "none",
			file: "http://localhost/aaa/10038.m3u8",
			duration: 57,
			flashplayer: 'player.swf',
			volume: 80,
			width: 720,
			plugins: { 'qualitymonitor.swf':{} },
            provider:'adaptiveProvider.swf',
		});
    	function loadStream(url) {
    		var thisurl= document.getElementById("stream_url").value;;
            jwplayer("player").load({file: thisurl,provider: 'adaptiveProvider.swf'});
            jwplayer("player").play();
            return false;
        }
    </script>
    <input type="text" name="stream_url" id="stream_url" />
    <input type="button"  onclick="loadStream()" value="loadStream" />
</body>
</html>


注意需要有qualitymonitor.swf这个文件

nginx需要配置
mimi.type
application/octet-stream              ts;
application/x-mpegURL                 m3u8;
nginx根目录下放,为了跨域问题
crossdomain.xml
参考
具体内容http://hi.baidu.com/%C0%EE%D5%F1%BF%AD123/blog/item/94e04683aa77fab26c811918.html

网上的例子
http://developer.longtailvideo.com/player/branches/adaptive/test/provider.html

参考
http://developer.longtailvideo.com/player/branches/adaptive/doc/reference.pdf
http://developer.longtailvideo.com/player/branches/adaptive/test/provider.html
http://www.longtailvideo.com/support/forums/jw-player/setup-issues-and-embedding/24109/jwplayer-adaptive-provider-wowza