1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-12 11:21:52 +00:00

add pdf of hls rfc, corrent the content type.

This commit is contained in:
winlin 2015-02-10 10:58:27 +08:00
parent fa4d3cd82c
commit 81ea6d34ce
3 changed files with 8 additions and 7 deletions

View file

@ -564,7 +564,7 @@ int SrsHlsMuxer::_refresh_m3u8(string m3u8_file)
// "#EXTINF:4294967295.208,\n" // "#EXTINF:4294967295.208,\n"
char ext_info[25]; // 14+10+1 char ext_info[25]; // 14+10+1
len = snprintf(ext_info, sizeof(ext_info), "#EXTINF:%.3f\n", segment->duration); len = snprintf(ext_info, sizeof(ext_info), "#EXTINF:%.3f,\n", segment->duration);
if ((ret = writer.write(ext_info, len, NULL)) != ERROR_SUCCESS) { if ((ret = writer.write(ext_info, len, NULL)) != ERROR_SUCCESS) {
srs_error("write m3u8 segment info failed. ret=%d", ret); srs_error("write m3u8 segment info failed. ret=%d", ret);
return ret; return ret;

View file

@ -56,7 +56,7 @@ using namespace std;
int srs_go_http_response_json(ISrsGoHttpResponseWriter* w, string data) int srs_go_http_response_json(ISrsGoHttpResponseWriter* w, string data)
{ {
w->header()->set_content_length(data.length()); w->header()->set_content_length(data.length());
w->header()->set_content_type("application/json;charset=utf-8"); w->header()->set_content_type("application/json");
return w->write((char*)data.data(), data.length()); return w->write((char*)data.data(), data.length());
} }
@ -344,17 +344,18 @@ int SrsGoHttpFileServer::serve_file(ISrsGoHttpResponseWriter* w, SrsHttpMessage*
_mime[".mp3"] = "audio/mpeg"; _mime[".mp3"] = "audio/mpeg";
_mime[".m4a"] = "audio/x-m4a"; _mime[".m4a"] = "audio/x-m4a";
_mime[".ogg"] = "audio/ogg"; _mime[".ogg"] = "audio/ogg";
_mime[".m3u8"] = "application/x-mpegURL;charset=utf-8"; // @see hls-m3u8-draft-pantos-http-live-streaming-12.pdf, page 5.
_mime[".m3u8"] = "application/vnd.apple.mpegurl"; // application/x-mpegURL
_mime[".rss"] = "application/rss+xml"; _mime[".rss"] = "application/rss+xml";
_mime[".json"] = "application/json;charset=utf-8"; _mime[".json"] = "application/json";
_mime[".swf"] = "application/x-shockwave-flash"; _mime[".swf"] = "application/x-shockwave-flash";
_mime[".doc"] = "application/msword"; _mime[".doc"] = "application/msword";
_mime[".zip"] = "application/zip"; _mime[".zip"] = "application/zip";
_mime[".rar"] = "application/x-rar-compressed"; _mime[".rar"] = "application/x-rar-compressed";
_mime[".xml"] = "text/xml;charset=utf-8"; _mime[".xml"] = "text/xml";
_mime[".html"] = "text/html;charset=utf-8"; _mime[".html"] = "text/html";
_mime[".js"] = "text/javascript"; _mime[".js"] = "text/javascript";
_mime[".css"] = "text/css;charset=utf-8"; _mime[".css"] = "text/css";
_mime[".ico"] = "image/x-icon"; _mime[".ico"] = "image/x-icon";
_mime[".png"] = "image/png"; _mime[".png"] = "image/png";
_mime[".jpeg"] = "image/jpeg"; _mime[".jpeg"] = "image/jpeg";