Hide pause/play button on vimeo iframe on hover

*爱你&永不变心* 提交于 2020-01-14 03:06:33

问题


I am using a Vimeo iframe on a website. I hide all the controls with the Vimeo Froogaloop API. But I can't hide the pause and play button that appear on hover. Somebody please help me.

$(document).ready(function(){
  jQuery('iframe.vimeo-player').each(function(){
      Froogaloop(this).addEvent('ready', ready);
  });
  function ready(playerID){
      console.log(playerID + ' is ready');

      // Add event listerns
      // http://developer.vimeo.com/player/js-api#events
      Froogaloop(playerID).addEvent('play', play(playerID));
      Froogaloop(playerID).addEvent('seek', seek);


      // Fire an API method
      // http://developer.vimeo.com/player/js-api#methods
      Froogaloop(playerID).api('play');
      Froogaloop(playerID).api('setVolume', 0);

  }
  function play(playerID){
      console.log(playerID + ' is playing');
  }
  function seek(data, playerID) {
      console.log(playerID + ' is seeking');
      console.log(data);
  }

});


回答1:


According to a forum post from 2 years ago, this is impossible. The post suggests upgrading to pro and using a third-party player.

The only other option would be to switch to a different video platform to get the features you want.

Edit:

It looks like it's actually possible. I just saw an example (linked to from this question) which has the buttons in question removed.

The key appears to be setting the parameter background=1 in the URL of the iframe. Oddly enough, this functionality does not appear on Vimeo's developer site.



来源:https://stackoverflow.com/questions/35404013/hide-pause-play-button-on-vimeo-iframe-on-hover

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!