笑故挽风 2014-02-04 01:39 采纳率: 100%
浏览 338

用AJAX加载VideoJS

I'm trying to load by AJAX a video working with VideoJS but I can't manage how to make it work after the AJAX load. I've been reading a lot about this but I couldn't find any solution.

I show you an example. You can check this link with a working video. And here I'm trying to load the previous link through an AJAX load.

This is the code I run after the AJAX call. You can check it also in the links I just entered.

_V_($('.video-container-large').find('.video-js')).ready(function(){
        var myPlayer = this;
        myPlayer.destroy();
        myPlayer.play();            
    });
    return false;
} );

Do you know why VideoJS is not initialized fine? I tried a lot of alternatives without any success, so any help will be much appreciated!

Thank you.

  • 写回答

1条回答 默认 最新

  • weixin_33724570 2014-02-04 16:20
    关注

    The argument passed to _V_() (or videojs()) should be an element or an id, not a jquery object. Use array notation to get the element from the object.

    videojs($('.video-container-large').find('.video-js')[0]).ready(function(){ …
    

    Note: _V_() was deprecated in video.js 4 and removed in video.js 5. Use videojs().

    评论

报告相同问题?

悬赏问题

  • ¥15 outlook无法配置成功
  • ¥15 Pwm双极模式H桥驱动控制电机
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换