HTML video element control does not display
P粉788765679
2023-08-18 12:54:43
<p>I created a video element and set the controls attribute to true, but the controls are not showing (even on hover)</p>
<pre class="brush:js;toolbar:false;">if (!this._player) {
this._player = document.createElement('video');
}
this._player.controls = true;
this._player.src = xxxxx;
</pre>
<p>Also set the width of the video element to 100%
The location of the container is relative</p>
<p>What should I do to display the default video controls</p>
This code will create a video element with default controls. The video element will be positioned absolutely and fill the entire screen. When the video starts playing or is paused, the event listener logs a message to the console.