MP4 files a开发者_如何学运维re 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:
http://www.simplethoughtproductions.com/wp-content/uploads/SimpleShorts/Morning_Mail/morning_mail.mp4
Why is that?
First link has Content-Type: application/octet-stream
header, while the second one Content-Type: video/mp4
.
With Serg's answer , I would also like to add about Content-Disposition
header . If you set the Content-Disposition as inline
, then your video/content will play within the browser and if you set Content-Disposition as attachment
, then your browser will download it .
More info on this can be found here .
精彩评论