Video 在brightcove中获取自定义视频字段
我在媒体API中创建了一个调用,用于检索名为“产品名称”的“自定义视频字段”,但检索失败。在“我的产品名称”列中,只会弹出“未定义”。我在下面的代码段中使用了((n.customFields)?n.productname:“”)来进行调用Video 在brightcove中获取自定义视频字段,video,custom-fields,brightcove,Video,Custom Fields,Brightcove,我在媒体API中创建了一个调用,用于检索名为“产品名称”的“自定义视频字段”,但检索失败。在“我的产品名称”列中,只会弹出“未定义”。我在下面的代码段中使用了((n.customFields)?n.productname:“”)来进行调用 function buildMAinVideoList() { //Wipe out the old results $("#tbData").empty(); console.log(oCurrentMainVideoList); oCurrentVid
function buildMAinVideoList() {
//Wipe out the old results
$("#tbData").empty();
console.log(oCurrentMainVideoList);
oCurrentVideoList = oCurrentMainVideoList;
// Display video count
document.getElementById('divVideoCount').innerHTML = oCurrentMainVideoList.length + " videos";
document.getElementById('nameCol').innerHTML = "Video Name";
//document.getElementById('headTitle').innerHTML = title;
document.getElementById('tdMeta').style.display = "block";
document.getElementById('checkToggle').style.display = "inline";
$("span[name=buttonRow]").show();
$(":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.customFields)?n.productname:'')+
"</td></tr>"
).children("tr").bind('click', function(){
showMetaData(this.id);
})
});
函数buildMAinVideoList(){
//抹去旧的结果
$(“#tbData”).empty();
console.log(oCurrentMainVideoList);
oCurrentVideoList=OcurrentMain视频列表;
//显示视频计数
document.getElementById('divVideoCount').innerHTML=oCurrentMainVideoList.length+“videos”;
document.getElementById('nameCol').innerHTML=“视频名称”;
//document.getElementById('headTitle')。innerHTML=title;
document.getElementById('tdMeta').style.display=“block”;
document.getElementById('checkToggle').style.display=“inline”;
$(“span[name=buttonRow]”)show();
$(“:button[name=delFromPlstButton]”).hide();
//对于每个检索到的视频,向表中添加一行
var modDate=新日期();
$.each(ocurrentmain视频列表,函数(i,n){
modDate.setTime(n.lastModifiedDate);
$(“#tbData”)。追加(
" \
\
\
"
+n、 名字+
""
+(modDate.getMonth()+1)+“/”+modDate.getDate()+“/”+modDate.getFullYear()+”\
"
+((n.customFields)?n.productname:“”)+
""
).children(“tr”).bind('click',function(){
showmatadata(this.id);
})
});
我在getPlaylist调用中进行了类似的调用,在调试器中显示了自定义字段,因此我知道它在上面的代码中。您的自定义字段将作为自定义字段的子字段返回。请尝试:
(n.customFields && n.customFields.productname)?n.customFields.productname:''
您的自定义字段将作为customFields的子字段返回。请尝试:
(n.customFields && n.customFields.productname)?n.customFields.productname:''
是否确定内部自定义字段名为“productname”而不是“product\u name”之类的其他名称?是否确定内部自定义字段名为“productname”而不是“product\u name”之类的其他名称?