MP4 正在下载而不是播放
MP4 文件有时会被下载,有时会在浏览器中播放。
这两个链接有什么区别?
1) 如果您在 Chrome 中打开此网址,将下载视频:
http://video. video-mall.com/video_mall/400241188377_video.mp4
2) 如果您在 Chrome 上打开此网址,视频将在浏览器中播放:
http://www.simplethoughtproducts.com/wp-content/uploads /SimpleShorts/Morning_Mail/morning_mail.mp4
这是为什么?
MP4 files are sometimes downloaded, and other times they play in the browser.
What is the difference between these two links?
1) If you open this URL in Chrome, the video will download:
http://video.video-mall.com/video_mall/400241188377_video.mp4
2) If you open this URL on Chrome, the video will play in the browser:
Why is that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
第一个链接具有
Content-Type: application/octet-stream
标头,而第二个链接具有Content-Type: video/mp4
。First link has
Content-Type: application/octet-stream
header, while the second oneContent-Type: video/mp4
.通过 Serg 的回答,我还想添加有关
Content-Disposition
header 。如果您将 Content-Disposition 设置为inline
,那么您的视频/内容将在浏览器中播放,如果您将 Content-Disposition 设置为attachment
,那么您的浏览器将下载它。有关此内容的更多信息,请访问此处 。
With Serg's answer , I would also like to add about
Content-Disposition
header . If you set the Content-Disposition asinline
, then your video/content will play within the browser and if you set Content-Disposition asattachment
, then your browser will download it .More info on this can be found here .