Javascript player.stop()dosen';t在videojs上工作

Javascript player.stop()dosen';t在videojs上工作,javascript,html5-video,video.js,Javascript,Html5 Video,Video.js,我正在尝试用IMA插件实现videojs,我需要从我的react应用程序的videobox外的按钮捕获停止播放事件。 问题是,我在按钮上捕捉事件,效果很好,但当我想停止广告时,它们就不起作用了。。为什么?有线索吗? 我用这个例子 https://googleads.github.io/videojs-ima/examples/simple/ 我登录player.ima并返回这个,但我无法访问任何元素 这是我的密码!谢谢 index.js <video id="content_video

我正在尝试用IMA插件实现videojs,我需要从我的react应用程序的videobox外的按钮捕获停止播放事件。 问题是,我在按钮上捕捉事件,效果很好,但当我想停止广告时,它们就不起作用了。。为什么?有线索吗? 我用这个例子

https://googleads.github.io/videojs-ima/examples/simple/
我登录player.ima并返回这个,但我无法访问任何元素

这是我的密码!谢谢

index.js

<video id="content_video" 
  class="video-js vjs-default-skin"" 
  controls 
>
<source src="//commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" type="video/mp4" ></source>
</video> 

<script>

window.player = videojs

var player =  window.player('content_video');

var options = {
    id: 'content_video',
    adTagUrl: 'http://pubads.g.doubleclick.net/gampad/ads?sz=640x480&iu=/124319096/external/ad_rule_samples&ciu_szs=300x250&ad_rule=1&impl=s&gdfp_req=1&env=vp&output=xml_vmap1&unviewed_position_start=1&cust_params=sample_ar%3Dpremidpostpod%26deployment%3Dgmf-js&cmsid=496&vid=short_onecue&correlator='
  };

  player.ima(options);


</script>
  handlePlay = () => {
        if(this.props.showPlay == 'block'){
            const player = window.videojs(`#content_video`)
            player.play() //only work on the video not in ads

        } else {
            const player = window.videojs(`#content_video`)
            player.pause() //only work on the video not in ads
        }
   }