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