0

我正在尝试在 Brightcove 中循环播放我的视频的演绎数组,并且无论我尝试什么都失败了。

document.getElementById('divMeta.render').innerHTML = v.renditions;

这段代码的结果是:

[对象对象],[对象对象],[对象对象],[对象对象],[对象对象],[对象对象]

显示有 6 个单独的演绎版。

videos: Array[20] 
0: Object
    FLVFullLength: Object
    FLVURL: "http://brightcove.vo.llnwd.net/pd16/media/1978114949001/1978114949001_2223781677001_Lindy-Fish---Game-Cleaning-Station-Features---Benefits.mp4?pub    
    Id=1978114949001&videoId=2223734749001"
    creationDate: "1363191473140"
    customFields: Object
    economics: "AD_SUPPORTED"
    id: 2223734749001
    lastModifiedDate: "1363200126320"
    length: 45094
    linkText: null
    linkURL: null
    longDescription: null
    name: "Lindy Fish & Game Cleaning Station Features & Benefits"
    playsTotal: 19
    playsTrailingWeek: 19
    publishedDate: "1363191473140"
    referenceId: null
   renditions: Array[6]
       0: Object
       1: Object
          audioOnly: false
         controllerType: "DEFAULT"
         displayName: "Lindy Fish & Game Cleaning Station Features & Benefits.mov"
         encodingRate: 1616956
         frameHeight: 700
         frameWidth: 1248
         id: 2223780276001
         referenceId: null
         remoteStreamName: null
         remoteUrl: null
         size: 9153763
         uploadTimestampMillis: 1363191560801
         url: "http://brightcove.vo.llnwd.net/pd16/media/1978114949001/1978114949001_2223780276001_Lindy-Fish---Game-Cleaning-Station-Features---Benefits.mp4?pub    
         Id=1978114949001&videoId=2223734749001"
         videoCodec: "H264"
         videoContainer: "MP4"
        videoDuration: 45094
        __proto__: Object
    2: Object
    3: Object
    4: Object
    5: Object
    length: 6

正如您在从上面的控制台日志中复制的文本中看到的那样,在再现中有 6 个不同的,我想调用 frameWidth = 1248 的 url。

有什么建议么?

4

1 回答 1

0

您可以循环遍历数组:

var url;
for (var i = 0; i < v.renditions.length; i++) {
    if (v.renditions[i].frameWidth == 1248) {
        url = v.renditions[i].url;
        break;
    }
}
于 2013-04-03T16:12:51.440 回答