【问题标题】:jwplayer: get video URL onCompletejwplayer:获取视频 URL onComplete
【发布时间】:2014-09-10 02:57:54
【问题描述】:

我正在尝试通过jwplayer().getPlaylistItem().file; onComplete 回调获取视频的 URL,但它没有返回任何内容。

jwplayer().onComplete(function(e) {
    var videoURL = this.getPlaylistItem().file;
    console.log('Completed = ' + videoURL);
});

【问题讨论】:

    标签: jwplayer


    【解决方案1】:

    我不确定 onComplete 但值得一试:

    var fileName = jwplayer().config.file
    var baseUrl = jwplayer().config.streamer
    var videoUrl = baseUrl + "/" + fileName
    

    【讨论】:

      【解决方案2】:

      您的代码似乎有效。

      jwplayer("container").setup({
        playlist: "http://content.jwplatform.com/feeds/13ShtP5m.rss",
        displaytitle: false,
        width: 640,
        height: 360
      });
      
      jwplayer().onComplete(function(e) {
          var videoURL = this.getPlaylistItem().file;
          console.log('Completed = ' + videoURL);
      });
      

      看这个例子:

      http://jsfiddle.net/rDs4P/

      如果还是不行,请提供你运行播放器的链接。

      【讨论】:

        【解决方案3】:

        应该是这样的:

        var videoURL = jwplayer().getPlaylistItem()['file'];
        

        【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-05-28
        • 1970-01-01
        相关资源
        最近更新 更多