问题描述
const toggleVideo = () => {
const currentVideo = videoRef.current
if (isPlaying) {
currentVideo.pause()
setIsPlaying(false)
} else {
currentVideo.play()
setIsPlaying(true)
}
}
<div className="video-wrapper">
<video ref={videoRef}>
<source src={src} type='video/mp4' />
</video>
<div className={isPlaying ? '' : "video-playpause"} ref={videoButtonRef}></div>
</div>
我想使用自定义按钮 为什么视频不起作用? 声音工作正常。停止,开始,停止……一切正常,但视频无法播放。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)