一开始,视频会显示,但它会停止。 我希望在浏览器启动时播放视频。
import React, { Component } from 'react';
class Cppersons extends Component {
myFocus () {
this.lastref.current.focus()
}
render() {
//something
return (
<div> Something </div>
)
}
}
export default Cppersons;
答案 0 :(得分:0)
froogaloop2 js现在无法正常使用 player.vimeo.com/api/player.js 。
试试这个
<iframe id="player" width="" height="" src="http://player.vimeo.com/video/62207569?api=1&player_id=player" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
<script src="https://player.vimeo.com/api/player.js"></script>
<script>
var frame = document.querySelector('iframe');
var jqueryPlayer = new Vimeo.Player(frame);
jqueryPlayer.play();
console.log('played the video!');
</script>
您可以参考此https://github.com/vimeo/player.js#create-a-player了解详情。