HTML5 Video - Suspend Loading / Partial Load

馋奶兔 提交于 2019-12-08 01:38:38

问题


Is there a way to preload a portion of a video, but not the entire thing? I noticed that there is a "suspend" event that indicates the video is expectedly not downloading until further instruction, but I'm unsure of how to trigger this event?

My goal is to preload a portion of a video without taking up all the users' bandwidth.

Thanks!


回答1:


You can pre-fetch any URL with XHR, but you can't control how much it pre-fetch from the client-side. I think you can try this: set a header in the XHR request indicating how much you want to pre-fetch, read this header on the server-side and only feed that much data to this request.



来源:https://stackoverflow.com/questions/5023448/html5-video-suspend-loading-partial-load

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!