Added xap smooth player file in smooth connector and fixed embed for this file

This commit is contained in:
ThatGuy 2013-08-28 14:43:28 +02:00 committed by Thulinma
parent 51d0d26a6e
commit fd4ea27a94
4 changed files with 24737 additions and 186 deletions

View file

@ -65,7 +65,7 @@ MistConnHTTPProgressiveMP4_SOURCES=connectors/conn_http_progressive_mp4.cpp ../V
MistConnHTTPProgressiveOGG_SOURCES=connectors/conn_http_progressive_ogg.cpp ../VERSION MistConnHTTPProgressiveOGG_SOURCES=connectors/conn_http_progressive_ogg.cpp ../VERSION
MistConnHTTPSRT_SOURCES=connectors/conn_http_srt.cpp ../VERSION MistConnHTTPSRT_SOURCES=connectors/conn_http_srt.cpp ../VERSION
MistConnHTTPDynamic_SOURCES=connectors/conn_http_dynamic.cpp ../VERSION MistConnHTTPDynamic_SOURCES=connectors/conn_http_dynamic.cpp ../VERSION
MistConnHTTPSmooth_SOURCES=connectors/conn_http_smooth.cpp ../VERSION MistConnHTTPSmooth_SOURCES=connectors/xap.h connectors/conn_http_smooth.cpp ../VERSION
MistConnHTTPLive_SOURCES=connectors/conn_http_live.cpp ../VERSION MistConnHTTPLive_SOURCES=connectors/conn_http_live.cpp ../VERSION
MistConnTS_SOURCES=connectors/conn_ts.cpp ../VERSION MistConnTS_SOURCES=connectors/conn_ts.cpp ../VERSION
MistConnHTTPSRT_SOURCES=connectors/conn_http_srt.cpp ../VERSION MistConnHTTPSRT_SOURCES=connectors/conn_http_srt.cpp ../VERSION

View file

@ -214,9 +214,22 @@ namespace Connector_HTTP {
}; };
if (HTTP_R.url.find(".xap") != std::string::npos){
#include "xap.h"
std::cout << "! sending xap player file" << std::endl;
HTTP_S.Clean();
HTTP_S.SetHeader("Content-Type", "application/siverlight");
HTTP_S.SetHeader("Cache-Control", "cache");
HTTP_S.SetBody("");
HTTP_S.SetHeader("Content-Length", xap_len);
HTTP_S.SendResponse("200", "OK", conn);
conn.SendNow((const char *)xap_data, xap_len);
}else{
if (HTTP_R.url.find("Manifest") == std::string::npos){ if (HTTP_R.url.find("Manifest") == std::string::npos){
//We have a non-manifest request, parse it. //We have a non-manifest request, parse it.
std::cout << "! NON manifest sauce file" << std::endl;
Quality = HTTP_R.url.substr(HTTP_R.url.find("/Q(", 8) + 3); Quality = HTTP_R.url.substr(HTTP_R.url.find("/Q(", 8) + 3);
Quality = Quality.substr(0, Quality.find(")")); Quality = Quality.substr(0, Quality.find(")"));
parseString = HTTP_R.url.substr(HTTP_R.url.find(")/") + 2); parseString = HTTP_R.url.substr(HTTP_R.url.find(")/") + 2);
@ -408,17 +421,21 @@ namespace Connector_HTTP {
handlingRequest = true; handlingRequest = true;
}else{ }else{
//We have a request for a Manifest, generate and send it. //We have a request for a Manifest, generate and send it.
std::cout << "! sending manifest player file" << std::endl;
HTTP_S.Clean(); HTTP_S.Clean();
HTTP_S.SetHeader("Content-Type", "text/xml"); HTTP_S.SetHeader("Content-Type", "text/xml");
HTTP_S.SetHeader("Cache-Control", "no-cache"); HTTP_S.SetHeader("Cache-Control", "no-cache");
std::string manifest = smoothIndex(Strm.metadata); std::string manifest = smoothIndex(Strm.metadata);
HTTP_S.SetBody(manifest); HTTP_S.SetBody(manifest);
conn.SendNow(HTTP_S.BuildResponse("200", "OK")); HTTP_S.SendResponse("200", "OK", conn);
}
} }
ready4data = true; ready4data = true;
//Clean for any possible next requests //Clean for any possible next requests
HTTP_R.Clean(); HTTP_R.Clean();
} }
}else{ }else{
//Wait 250ms before checking for new data. //Wait 250ms before checking for new data.
Util::sleep(250); Util::sleep(250);

View file

@ -145,7 +145,7 @@ function mistembed(streamname)
break; break;
case 'silverlight': case 'silverlight':
container.innerHTML = '<object data="data:application/x-silverlight," type="application/x-silverlight" width="' + videowidth + '" height="' + videoheight + '"><param name="source" value="SmoothStreamingSamplePlayer.xap"/><param name="onerror" value="onSilverlightError" /><param name="autoUpgrade" value="true" /><param name="background" value="white" /><param name="enableHtmlAccess" value="true" /><param name="minRuntimeVersion" value="3.0.40624.0" /><param name="initparams" value =\'autoload=false,autoplay=true,displaytimecode=false,enablecaptions=true,joinLive=true,muted=false,playlist=<playList><playListItems><playListItem title="Test" description="testing" mediaSource="' + encodeURI(src.url) + '" adaptiveStreaming="true" thumbSource="" frameRate="25.0" width="" height=""></playListItem></playListItems></playList>\' /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"> <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none" /></a></object>'; container.innerHTML = '<object data="data:application/x-silverlight," type="application/x-silverlight" width="' + videowidth + '" height="' + videoheight + '"><param name="source" value="' + encodeURI(src.url) + '/player.xap"/><param name="onerror" value="onSilverlightError" /><param name="autoUpgrade" value="true" /><param name="background" value="white" /><param name="enableHtmlAccess" value="true" /><param name="minRuntimeVersion" value="3.0.40624.0" /><param name="initparams" value =\'autoload=false,autoplay=true,displaytimecode=false,enablecaptions=true,joinLive=true,muted=false,playlist=<playList><playListItems><playListItem title="Test" description="testing" mediaSource="' + encodeURI(src.url) + '" adaptiveStreaming="true" thumbSource="" frameRate="25.0" width="" height=""></playListItem></playListItems></playList>\' /><a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;"> <img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none" /></a></object>';
break; break;

24534
src/connectors/xap.h Normal file

File diff suppressed because it is too large Load diff