Stop a Vimeo Video with Jquery

前端 未结 4 1836
迷失自我
迷失自我 2021-01-20 21:26

I need to stop a Vimeo video embedded with new oembed api (universal player) but when I try to add an event I get this error:

Uncaught TypeError: Object #<         


        
4条回答
  •  青春惊慌失措
    2021-01-20 22:21

    Eli, please edit your post. As Joe said, you are partially misinformed. While postMessage is needed for cross-domain communication, it is implemented through a DOM method added by a call to "Froogaloop.init();"

    is_embed_iframe = _this.iframe_pattern.test(cur_frame.getAttribute('src')); 
    
    if (is_embed_iframe) {
            cur_frame.api = _that.api;
            cur_frame.get = _that.get;
            cur_frame.addEvent = _that.addEvent;
        }
    

    Note: you will need to grab froogaloop.js (or the min variant) from the Vimeo site.

    Be sure the iFrame "src" is set prior to calling init(), otherwise froogaloop will do nothing.

提交回复
热议问题