How to make a loading image when loading HTML5 video?

后端 未结 6 1943
谎友^
谎友^ 2020-12-14 18:16

As it takes time for the video player to load the mp4 video, does HTML5 support playing a \"loading\" logo when loading the video ?

6条回答
  •  太阳男子
    2020-12-14 18:38

    You could probably do it with JavaScript by creating an image overlay with an animated "loading" gif which you only display when the video is loading and is not ready to play.

    You'd have to write JavaScript to link up with the Media API for detecting when the video is ready to play and so forth though (so you could hide the image again), but it should be possible.

提交回复
热议问题