HTML5 Video Seamless Looping

前端 未结 4 1471
轻奢々
轻奢々 2021-02-12 10:31

I know this question has been asked a number of times, and I\'ve looked through every single one of them here on StackOverflow.

I\'m simply trying to loop a 5 second MP4

4条回答
  •  误落风尘
    2021-02-12 11:17

    Try this:
    1) edit your video this way:
    [1s][2s][3s][4s][5s]
    cut 1st second block of the video and append it 2x to the end like this:
    [2s][3s][4s][5s][1s][1s]

    2) Use code:

    
    
    
    
    

    The idea behind this is to make the video seamless (the end of the video is the beginning of the video). Also, you have to make sure the video never ends. The loop attribute works with smaller video files but you see a black image at the end of the video if too large (before the next looping iteration). Essentially before the video ends, you are seeking back to 0.0s.

    I hope that helps.

提交回复
热议问题