|
|
@ -639,9 +639,10 @@ if ($('#my-player').length > 0 && typeof(videojs) != 'undefined') { |
|
|
|
|
|
|
|
|
|
|
|
//加载更多视频
|
|
|
|
//加载更多视频
|
|
|
|
var currentPage = $('.othervideos').attr('data-page'), |
|
|
|
var currentPage = $('.othervideos').attr('data-page'), |
|
|
|
|
|
|
|
currentPageSize = $('.othervideos').attr('data-page-size'), |
|
|
|
currentVideoId = $('.othervideos').attr('data-id'); |
|
|
|
currentVideoId = $('.othervideos').attr('data-id'); |
|
|
|
var callback_loadNextPage = null; |
|
|
|
var callback_loadNextPage = null; |
|
|
|
var getOtherVideos = function(currentPage) { |
|
|
|
var getOtherVideos = function() { |
|
|
|
if (_noMoreVideos) {return false;} |
|
|
|
if (_noMoreVideos) {return false;} |
|
|
|
var videoId = $('.othervideos').attr('data-id'), |
|
|
|
var videoId = $('.othervideos').attr('data-id'), |
|
|
|
cateId = $('.othervideos').attr('data-pid'), |
|
|
|
cateId = $('.othervideos').attr('data-pid'), |
|
|
@ -652,7 +653,8 @@ if ($('#my-player').length > 0 && typeof(videojs) != 'undefined') { |
|
|
|
cid: cacheId, |
|
|
|
cid: cacheId, |
|
|
|
show: 'video', |
|
|
|
show: 'video', |
|
|
|
dataType: 'video', |
|
|
|
dataType: 'video', |
|
|
|
page: currentPage |
|
|
|
page: currentPage, |
|
|
|
|
|
|
|
limit: currentPageSize |
|
|
|
}; |
|
|
|
}; |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: api, |
|
|
|
url: api, |
|
|
@ -675,15 +677,20 @@ if ($('#my-player').length > 0 && typeof(videojs) != 'undefined') { |
|
|
|
callback_loadNextPage(data.videos); |
|
|
|
callback_loadNextPage(data.videos); |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
_noMoreVideos = true; |
|
|
|
if (currentPage > 1) { |
|
|
|
console.warn('获取更多视频数据出错啦', data.msg); |
|
|
|
currentPage = 1; //重新从第一页循环播放
|
|
|
|
|
|
|
|
getOtherVideos(); |
|
|
|
|
|
|
|
}else { |
|
|
|
|
|
|
|
_noMoreVideos = true; |
|
|
|
|
|
|
|
console.warn('获取更多视频数据出错啦', data.msg); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}).fail(function(jqXHR, textStatus, errorThrown) { |
|
|
|
}).fail(function(jqXHR, textStatus, errorThrown) { |
|
|
|
console.error('获取更多视频数据失败,错误信息:' + errorThrown); |
|
|
|
console.error('获取更多视频数据失败,错误信息:' + errorThrown); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
getOtherVideos(currentPage); |
|
|
|
getOtherVideos(); |
|
|
|
|
|
|
|
|
|
|
|
//自动播放
|
|
|
|
//自动播放
|
|
|
|
var playNextVideo = function() { |
|
|
|
var playNextVideo = function() { |
|
|
@ -708,7 +715,7 @@ if ($('#my-player').length > 0 && typeof(videojs) != 'undefined') { |
|
|
|
playNextVideo(); |
|
|
|
playNextVideo(); |
|
|
|
}; |
|
|
|
}; |
|
|
|
currentPage = parseInt(currentPage) + 1; |
|
|
|
currentPage = parseInt(currentPage) + 1; |
|
|
|
getOtherVideos(currentPage); |
|
|
|
getOtherVideos(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|