一旦在我的 React JS 应用程序中调用任何函数,Youtube 视频就会自动停止
Youtube video stops automatically as soon as any function is called in my React JS app
我在 React JS 中使用来自 'react-youtube-player' 的 YoutubePlayer。
<YoutubePlayer
playbackState = 'unstarted'/>
现在,每当在我的网页上触发任何功能时,它都会将其状态更改为未启动。因此,如果它正在播放或暂停,它将无法启动。
如何解决?
我找到了解决方案。使用 react-youtube npm 包。它工作正常。
我在 React JS 中使用来自 'react-youtube-player' 的 YoutubePlayer。
<YoutubePlayer
playbackState = 'unstarted'/>
现在,每当在我的网页上触发任何功能时,它都会将其状态更改为未启动。因此,如果它正在播放或暂停,它将无法启动。
如何解决?
我找到了解决方案。使用 react-youtube npm 包。它工作正常。