我下载了版本" JW Player 7(自托管)"。
然后我将未压缩的文件夹jwplayer-7.1.0复制到/ home / vmg / public_html /。它包含以下文件和文件夹:
我已在jwplayer-7.1.0文件夹中保存了一段视频(video.mp4)和一张图片(image.jpg)。接下来,我编辑了文件夹public_html /:
中包含的index.html<!DOCTYPE html>
<html>
<head>
<!-- JS jwplayer 6.8 -->
<script type="text/javascript" src="jwplayer-7.1.0/jwplayer.js"></script>
<!-- JWplayer Licence - put your licence here -->
<script type="text/javascript">jwplayer.key="CKjOe06GxAOe3Dj9NaWPCQKtqvqQdyFV8z9wsg==";</script>
</head>
<body>
<div id="video">Loading the player...</div>
<script type="text/javascript">
var playerInstance = jwplayer("video");
playerInstance.setup({
file: "jwplayer-7.1.0/video.mp4",
image: "jwplayer-7.1.0/image.jpg",
width: 384,
height: 216,
title: 'Basic Video Embed',
description: 'A video with a basic title and description!'
});
</script>
</body>
</html>
我在Chrome上打开此文件并且可以正常运行。
但是我想使用流媒体内容,我看到此链接http://doc.streamroot.io/doc/latest/en/Front_end_player_configuration/Players_Instructions/JWplayer.html用于此播放器的先前版本。它似乎适用于MPEG-DASH清单和HLS播放列表。
使用上面提到的链接中显示的index.html:
<script type="text/javascript" src="jwplayer-7.1.0/jwplayer.js"></script>
,玩家无法工作。
<!DOCTYPE html>
<html>
<head>
<!-- JS jwplayer 6.8 -->
<script type="text/javascript" src="jwplayer-7.1.0/jwplayer.js"></script>
<!-- JWplayer Licence - put your licence here -->
<script type="text/javascript">jwplayer.key="....";</script>
<!-- Streamroot API (needs to be defined before the streamroot wrapper)-->
<script src="http://files.streamroot.io/release/1.1/api.js"></script>
<!-- Streamroot wrapper and loader -->
<script type="text/javascript">
streamrootWrapperSrc = "http://files.streamroot.io/release/1.1/wrappers/jwplayer/6.8/streamroot.wrapper.min.js";
</script>
<script type="text/javascript" src="http://files.streamroot.io/release/1.1/wrappers/jwplayer/6.8/srloader.js"></script>
</head>
<body>
<div id="streamrootPlayer" class="video">
</div>
<script>
jwplayer("streamrootPlayer").setup({
// Streamroot manifest source to place in the playlist
playlist : [{
sources: [
{ // HLS LIVE Manifest - works with Streamroot HTML5 and Flash modules.
file: "http://wowza.streamroot.io:1935/live/stream1/playlist.m3u8",
type: "application/x-mpegurl"
},
{ // MPEG-DASH VOD Manifest - works with Streamroot HTML5 and Flash modules.
file: "http://wowza.streamroot.io:1935/vod/snow.mp4/manifest.mpd",
type: "video/dash"
},/* { // RTMP LIVE Stream - if needed for fallbacks
file: "rtmp://wowza.streamroot.io:1935/live",
type: "video/rtmp"
}, { // MP4 VOD Stream - if needed for fallbacks
file: "http://content.jwplatform.com/videos/HkauGhRi-640.mp4",
type: "video/mp4"
}*/
]
}],
logo : {
file : "logo.jpg",
hide : true,
link : ""
},
abouttext : "Your About Text",
height: 360,
width: 640,
// enable streamroot playback and wrapper
primary: "streamroot",
streamrootplayer: "http://files.streamroot.io/release/1.1/wrappers/jwplayer/6.8/jwplayer.streamroot.js",
srflashplayer : "http://files.streamroot.io/release/1.1/wrappers/jwplayer/6.8/jwplayer.srflash.swf",
// streamroot API options
sr_options: {
ID_CLIENT : "ry-1t3stst12",
TRACKER_URL:"http://tracker.streamroot.io:80"
}
});
</script>
</body>
</html>
我认为这些Streamroot库并不适合jwplayer 7.1,但它们并不包含在下载的文件夹中。我做错了什么?
非常感谢你!
答案 0 :(得分:1)
此Streamroot文档页面已过时。检查this one。
尝试上面的代码段。 更多信息HERE。
<!DOCTYPE html>
<html>
<head>
<script src="//p.jwpcdn.com/6/8/jwplayer.js"></script>
<script>jwplayer.key="CKjOe06GxAOe3Dj9NaWPCQKtqvqQdyFV8z9wsg==";</script>
<script src="//files.streamroot.io/release/latest/api.js"></script>
<script src="//files.streamroot.io/release/latest/wrappers/jwplayer/6.8/streamroot.wrapper.min.js"></script>
</head>
<body>
<div id="streamrootPlayer" class="video"></div>
<script>
jwplayer("streamrootPlayer").setup({
playlist : [
{ // PLACE YOUR MANIFEST URL HERE
file: "http://media.streamroot.io/dash/examples/snow15/snowboard1_720p_dash.mpd",
type: "video/dash"
},
{ // MP4 VOD Stream - fallback for old browsers and devices
file: "http://content.jwplatform.com/videos/HkauGhRi-640.mp4",
type: "video/mp4"
}
],
logo: {
hide: true,
file: ""
},
autostart: 1,
streamrootplayer: "http://files.streamroot.io/release/latest/wrappers/jwplayer/6.8/jwplayer.streamroot.js",
srflashplayer : "http://files.streamroot.io/release/latest/wrappers/jwplayer/6.8/jwplayer.srflash.swf",
sr_options: {
ID_CLIENT : "ry-1t3stst12",
DEBUG: true
}
});
</script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/rickshaw/1.4.6/rickshaw.min.js"> </script>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/rickshaw/1.4.6/rickshaw.min.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/d3/3.4.9/d3.min.js"> </script>
<script src="http://files.streamroot.io/release/latest/scripts/p2pGraph.js"></script>
</body>
</html>
&#13;