Why don't all videos load on page in Chrome?

前端 未结 1 829
陌清茗
陌清茗 2021-01-29 11:18

http://graysonearle.com/bluemen/ Click on that with a webkit browser. On load it should have a 4x4 grid of videos appear, but only 1-3 videos tend to load on Chrome. Works just

1条回答
  •  一生所求
    2021-01-29 11:38

    if you suffix each video with a cache buster it seems to work fine. On Chrome it does the right thing and loads the first frame as a poster fairly quickly, but on Safari you need to explicitly select a poster

     
     
    
        
        
    
     
    
     
    
    

    If that doesn't work (and it looks like the browser buffer can still sometimes get choked) then what you need to do is load the video sources one by one, triggering the load on the canplaythrough event.

    all in all it doesn't seem very robust, good luck

    EDIT

    Okay, this version is more robust, but needs a little tidying up.... it grabs the video once as a blob via an async ajax call, then passes it as the source to each of the video elements... you'd probably want to load a poster into the videos and display some sort of progress bar until the video has loaded. I had to do this sample against my test video because I don't have cross-domain rights to your domain so couldn't easily test with your size video... but give it a try

    
    
    
    
    
    
    
    
    
    
    
    

    0 讨论(0)
提交回复
热议问题