我对 java 脚本的整个想法很陌生,我真的很想找到解决我的问题的方法。我已经放弃了 brightcove 用于视频管理器的模板,该模板使用“获取所有播放列表 URL”调用。我试图只制作一个包含几个特定播放列表的菜单,并且在这样做时会出现一个又一个错误,无论我改变什么。截至目前,我的主要错误是“未捕获的类型错误:无法读取未定义的属性'长度'”。任何帮助将不胜感激。谢谢你。
//Get PlayList by ID
function getPlaylistLindyURL(){
loadStart();
paging.playlistbyid = (paging.currentFunction == getPlaylistLindyURL)?paging.generic:paging.playlistbyid;
paging.currentFunction = getPlaylistLindyURL;
return apiLocation +
'?command=find_playlist_by_id&playlist_id=1990786315001&callback=showPlaylistByIDCallBack'
+ '&get_item_count=true&page_size=' + paging.size + '&page_number='+paging.playlistbyid
+'&token='+readToken;
//Playlist by ID callback
function showPlaylistByIDCallBack(o){
if(null == o.error){
oCurrentMainVideoList = o.items;
buildMAinVideoList();
doPageList(o.total_count, "Videos");
}else{
var message = (null!=o.error.message)?o.error.message:o.error;
alert("Server Error: "+ message);
}
loadEnd();
}
//For PlayList by ID
function buildMAinVideoList() {
//Wipe out the old results
$("#tbData").empty();
// Display video count
document.getElementById('divVideoCount').innerHTML = oCurrentMainVideoList.length + "Video";
document.getElementById('nameCol').innerHTML = "Video Name";
document.getElementById('headTitle').innerHTML = "All Videos";
document.getElementById('search').value = "Search Videos";
document.getElementById('tdMeta').style.display = "none";
document.getElementById('searchDiv').style.display = "none";
document.getElementById('checkToggle').style.display = "none";
$("span[name=buttonRow]").hide();
$(":button[name=delFromPlstButton]").hide();
//For each retrieved video, add a row to the table
var modDate = new Date();
$.each(oCurrentMainVideoList, function(i,n){
modDate.setTime(n.lastModifiedDate);
$("#tbData").append(
"<tr style=\"cursor:pointer;\" id=\""+(i)+"\"> \
<td>\
<input type=\"checkbox\" value=\""+(i)+"\" id=\""+(i)+"\" onclick=\"checkCheck()\">\
</td><td>"
+n.name +
"</td><td>"
+(modDate.getMonth()+1)+"/"+modDate.getDate()+"/"+modDate.getFullYear()+"\
</td><td>"
+n.id+
"</td><td>"
+((n.referenceId)?n.referenceId:'')+
"</td></tr>"
).children("tr").bind('click', function(){
showMetaData(this.id);
})
});