【发布时间】:2019-07-31 03:01:28
【问题描述】:
我有
<video id="video_player">
<source id="video_player_source"/>
</video>
在我的 html 文件中,并且
const videoPlayer = document.getElementById("video_player") as HTMLVideoElement;
const videoPlayerSource = document.getElementById("video_player_source") as HTMLElement;
videoPlayer.setAttribute("style", `top: 0; left: 0; width: 100%; `);
videoPlayerSource.setAttribute("src", "https://www.html5rocks.com/en/tutorials/track/basics/treeOfLife/video/developerStories-en.webm");
videoPlayer.play();
在我的渲染器进程中(视频是演示视频)。
视频确实加载了(屏幕上显示了一帧视频),但是当我拨打 play() 时它没有播放。
我该如何解决这个问题?谢谢。
【问题讨论】:
标签: typescript electron