1
我有以下配置我的页面上有多个jwplayer视频:jwplayer播放一个视频,并停止所有其他
$(function(){
//add attributes to your ".video" DIV placeholder to customimize output
//example: data-autostart="true" - see customSettings Object below.
if (typeof(jwplayer) !== 'undefined'){
$('.video').each(function(){
var vid = $(this),
videoSettings = {},
settings = {
autostart: false,
width: '100%',
aspectratio: '16:9',
image: ''
},
customSettings = {
autostart: vid.attr('data-autostart'),
width: vid.attr('data-width'),
aspectratio: vid.attr('data-aspectratio'),
image: vid.attr('data-image')
};
$.extend(videoSettings, settings, customSettings);
var playerInstance = jwplayer(vid.attr('id')).setup({
primary: "flash",
file: Drupal.settings.basePath + $(this).attr('data-src'),
autostart: videoSettings.autostart,
aspectratio: videoSettings.aspectratio,
image: Drupal.settings.basePath + videoSettings.image,
skin: "glow",
stretching: "exactfit",
width: videoSettings.width,
ga:{idstring: videoSettings.videotitle,
trackingobject: "pageTracker"
}
});
});
}
});
我试图补充一点:
events: {
onReady: function()
{
jwplayer($('.video').id).stop();
}
},
但我得到以下错误:
[.PPAPIContext] GL ERROR:GL_INVALID_ENUM:glTexImage2D:目标是GL_TEXTURE_RECTANGLE_ARB
有没有办法让所有其他视频在播放时停止播放?
你有一个链接,这 – Hitesh