我遇到的jwplayer问题似乎只发生在Firefox中 - 在Chrome和IE中一切正常。这是在ASP .Net Web表单页面上。视频播放器位于用户控件中,位于页面上。
1)当视频播放并结束时,它会停止播放,但实际上并未完成。 .onComplete事件永远不会触发。如果我摆弄重新加载页面并点击播放,我可以解雇它。但不是一贯的。
这是我的代码:
jwplayer("myElement").setup({
file: '<%= VideoUrl %>',
image: '<%=ThumbnailImageUrl %>',
width: "100%",
aspectratio: "16:9",
primary: thePrimary
});
jwplayer("myElement").onReady(function () {
jwplayer("myElement").onPlay(function () {
var obj = this; //save a reference to 'this' jw object for reference in the setInterval callback.
if (init_play == false) {
init_play = true;
if (trackingEnabled == 'True') {
this.seek(start);
init_play = true;
logVideoEvent(7, $('#<%=VideoIDHidden.ClientID %>').val(), 6, $('#PersonID').val(), $('#ContentPageID').val());
} else {
init_play = true;
}
}
if (!obj.playBegan) { //we only want this to trigger once when play begins (not on seek or ffd)
obj.playBegan = true;
HideValidationErrors();
obj.durationProcessor = setInterval(function () {
if (obj.getDuration() !== -1) { //sometimes the movie duration isn't immediately available.
clearTimeout(obj.durationProcessor);
var filepath = jwplayer("myElement").getPlaylistItem()['file'];
var mycounter = 0;
obj.onTime(function (event) {
mycounter++;
if (mycounter == 10) {
if (trackingEnabled == 'True') {
updateVideoProgress($('#<%=PersonVideoProgressID.ClientID %>').val(), $('#PersonCourseRelationshipID').val(), $('#ContentPageID').val(), $('#<%=VideoIDHidden.ClientID %>').val(), event.position, event.duration);
}
mycounter = 0;
}
});
}
}, 0); //look for a duration every .25 seconds
}
});
jwplayer("myElement").onComplete(function () {
if (trackingEnabled == 'True') {
if ($('#<%=WelcomeStepHidden.ClientID %>').val() == '4') {
updateWelcomeProgress($('#<%=PersonWelcomeProgressID.ClientID %>').val(), $('#PersonCourseGroupRelationshipID').val(), 4, true);
}
if ($('#<%=WelcomeStepHidden.ClientID %>').val() == '1') {
updateWelcomeProgress($('#<%=PersonWelcomeProgressID.ClientID %>').val(), $('#PersonCourseGroupRelationshipID').val(), 1, false);
}
logVideoEvent(13, $('#<%=VideoIDHidden.ClientID %>').val(), 6, $('#PersonID').val(), $('#ContentPageID').val());
}
});
$("a[title='" + urlsegment + "']").click();
});
2)也许相关?自动播放在Firefox中似乎不起作用。出现加载图标,但只是旋转。我必须手动暂停并再次点击播放才能播放。有时,当我这样做时,它开始播放,但加载图标永远不会消失。如果我去JWPlayer网站播放他们的示例视频,它似乎工作正常。