在播放视频结束时,jwplayer会显示一个覆盖整个jwplayer矩形的"共享"用户界面 - 这是一个带有3个标签的标签窗口,'分享','嵌入','信息'.我需要让这个"分享"用户界面消失.
为了替换这个"共享"用户界面,我假设Jwplayer在完成视频播放作为标准行为之后就出现了 - 我为onIdle,onComplete和onReady事件添加了事件处理程序.
在事件处理程序中,我完全按照代码在创建播放器时执行的操作:我使用默认视频和默认图像加载播放列表:
// this is called immediately after jwplayer.setup()
jwplayer().onComplete(function playerOnCompleteEvent(){handlePlayerComplete(jwplayer);});
// this gets called for the onComplete event
function handlePlayerComplete(theJwPlayer)
{
playlist = { file: 'http://localhost/theWebsite/videos/moto_sounds.flv',
image: 'http://localhost/theWebsite/images/mybanner2.jpg' };
alert("in handlePlayerIdle: the playlist file is "
+ playlist.file + " and image is " + playlist.image);
theJwPlayer().load(playlist);
}
Run Code Online (Sandbox Code Playgroud)
"警告"框告诉我播放列表文件和图像是正确的.我知道我的事件处理程序正在被调用 - 我在处理程序中使用一个警告框来证明这一点.
但"共享"3标签窗口不会消失.播放后仍然存在 - onIdle和onReady都使用上面相同的代码 - 没有帮助.
'分享'用户界面 - 如何在视频播放完成后用'mybanner2.jpg'替换它?
小智 5
下载jwplayer时,请确保选择不包含"病毒"插件的版本,这就是您所看到的.如果要将其保留在视频菜单中,则可以设置参数,使其在视频完成时不允许运行.我使用jwplayer.js文件将播放器放在我的页面上,所以我的设置看起来像这样(它在视频完成时关闭病毒插件屏幕,并暂停):
jwplayer("mediaplayer").setup({
'flashplayer': 'player.swf',
'file': 'http://www.linktovideo.com/video.mp4',
'image': 'video-screen-ss.jpg',
'height': '380',
'width': '512',
'dock': 'true',
'stretching': 'uniform',
'plugins': {
'viral-2': {'oncomplete':'False','onpause':'False','functions':'All'}
},
'events': {
onReady: function(event){ alert("player is ready"); }
}
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2477 次 |
| 最近记录: |