Brightcove Smart Player를 지원하도록 플래시 전용 코드를 업그레이드하여 HTML5간에 자동 전환합니다.Brightcove 스마트 플레이어 - 재생 목록으로 여러 동영상
단일 비디오 플레이어를 문제없이 전환 할 수있었습니다. 기존 코드에서 자바 스크립트에 여러 개의 videoID를로드하여 재생 목록을 시뮬레이션 할 수 있습니다. 사용자가 Brightcove에서 재생 목록을 만들지 않습니다. 그들은 CMS에 videoID를 입력 할 수 있으며 동적으로로드합니다. 우리는 기본적으로 videoIDs의 쉼표로 구분 된 목록입니다 videoList라는 매개 변수를 포함
function onTemplateReady(e) {
videoList = exp.getElementByID("videoList");
if (videoList != null) {
var mediaIdsToRequest = videoIDs;
content.getMediaInGroupAsynch(mediaIdsToRequest);
}
videoLoading = false;
}
function onMediaCollectionLoad(e) {
if (e.mediaCollection != null) { // This means the mediaCollection is a Playlist or group of videos
var mediaDTOs = new Array();
for (var i = 0; i < e.mediaCollection.mediaCount; i++) {
mediaDTOs[i] = content.getMedia(e.mediaCollection.mediaIds[i]);
}
videoList.setData(mediaDTOs);
// Visually selects the first video in the list
videoList.setSelectedIndex(0);
// Cues up the first video of the list in the videoPlayer component but doesn't start playing it
video.cueVideo(mediaDTOs[0].id);
}
}
:
다음은 이전 코드입니다. 문제는 MEDIA_COLLECTION_LOAD 이벤트가 새 API에없는 것 같습니다. 지금이 작업을 수행하는 권장 방법은 무엇입니까?
VideoPlayer 클래스가이 문제를 처리하고있는 것처럼 보입니다. 이 스마트 플레이어 솔루션을 확인하십시오. http://support.brightcove.com/en/docs/dynamically-loading-videos-using-smart-player-api – jco