我添加360视频到网站,我想添加播放和暂停按钮。我有以下代码为我的视频。我非常感谢你的帮助。
<script type="text/javascript">
window.addEventListener('load', onVrViewLoad);
var vrView = new VRView.Player('#vrview', {
width: '100%',
height: 400,
video: 'german.mp4',
is_stereo: false,
});
}
</script><html>
<script src="//storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script>
<div id="vrview"></div>
</html>
发布于 2017-02-14 13:45:49
首先,如果你想成功播放视频,你必须这样做:
不要使用storage.googleapis.com/vrview/2.0/build/vrview.min.js.
vrview-master/build/vrview.js.其次,您需要有用于播放和暂停的按钮,查看示例压缩,需要链接style.css,并在style.css中具有正确的路径,如下所示。
background: url('vrview-master/examples/img/ic_pause_black_24dp.svg');发布于 2017-07-02 15:01:39
window.addEventListener('load', onVrViewLoad)
let veView;
function onVrViewLoad() {
vrView = new VRView.Player('#vrview', {
video: '//vr.jwplayer.com/content/AgqYcfAT/AgqYcfAT-8yQ1cYbs.mp4',
width: '300',
height: '180'
});
}
function play(){
vrView.play()
}
function pause(){
vrView.pause()
}
function mute(){
vrView.setVolume(0)
}
function unmute(){
vrView.setVolume(1)
}<script src="//storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script>
<body>
<div id="vrview"></div>
<button type="button" onclick="play()">Play</button>
<button type="button" onclick="pause()">Pause</button>
<button type="button" onclick="mute()">Mute</button>
<button type="button" onclick="unmute()">UnMute</button>
</body>
https://stackoverflow.com/questions/42038940
复制相似问题