As I delve into the world of HTML5 video tags, I encountered an issue where the video wouldn't show a preview frame initially. Instead, only the Resume button would appear. Furthermore, after playing the video with the Resume button, it wouldn't automatically display the button again once the video ended. Surprisingly, this problem seemed to be isolated to non-Android devices.
https://i.sstatic.net/09O1B.png
In order to address this issue, my goal is to create a preview image with a visible resume button. Additionally, I aim to implement a solution that will reset the video playback state after it reaches the end.
const recordedMedia = document.createElement("video");
recordedMedia.controls = true;
// recordedMedia.autoplay = true;
recordedMedia.setAttribute('playsinline', 'true')
// recordedMedia.setAttribute('data-wf-ignore', 'true')
// recordedMedia.setAttribute('data-object-fit', 'cover')
recordedMedia.setAttribute('preload', 'metadata')
recordedMedia.setAttribute('type', "video/mp4")