mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Updated TypeScript to version 1.4.
Download from here: https://visualstudiogallery.msdn.microsoft.com/2d42d8dc-e085-45eb-a30b-3f7d50d55304
This commit is contained in:
parent
102fb14d9a
commit
caa50ad440
@ -25,7 +25,7 @@
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<TypeScriptToolsVersion>1.0</TypeScriptToolsVersion>
|
||||
<TypeScriptToolsVersion>1.4</TypeScriptToolsVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -1,4 +1,4 @@
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/jquery.d.ts" />
|
||||
/// <reference path="typings/underscore.d.ts" />
|
||||
var __extends = this.__extends || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
@ -8,9 +8,13 @@ var __extends = this.__extends || function (d, b) {
|
||||
};
|
||||
var Orchard;
|
||||
(function (Orchard) {
|
||||
var Azure;
|
||||
(function (Azure) {
|
||||
var MediaServices;
|
||||
(function (MediaServices) {
|
||||
var VideoPlayer;
|
||||
(function (VideoPlayer) {
|
||||
var Injectors;
|
||||
(function (Injectors) {
|
||||
var DashInjector = (function (_super) {
|
||||
__extends(DashInjector, _super);
|
||||
@ -19,69 +23,52 @@ var Orchard;
|
||||
}
|
||||
DashInjector.prototype.isSupported = function () {
|
||||
var videoElement = document.createElement("video");
|
||||
var mse = window["MediaSource"] || window["WebKitMediaSource"];
|
||||
|
||||
var hasH264 = videoElement && videoElement.canPlayType && !!videoElement.canPlayType("video/mp4; codecs=\"avc1.42001E, mp4a.40.2\"");
|
||||
var hasMse = mse && mse.isTypeSupported && mse.isTypeSupported("video/mp4; codecs=\"avc1.4d404f\"");
|
||||
var hasMse = MediaSource && MediaSource.isTypeSupported && MediaSource.isTypeSupported("video/mp4; codecs=\"avc1.4d404f\"");
|
||||
var hasDynamicAssets = _(this.filteredAssets().DynamicVideoAssets).any();
|
||||
|
||||
this.debug("Browser supports HTML5 video and the H264 and AAC codecs: {0}", hasH264);
|
||||
this.debug("Browser supports the Media Source Extensions API: {0}", hasMse);
|
||||
this.debug("Item has at least one dynamic video asset: {0}", hasDynamicAssets);
|
||||
|
||||
var result = hasH264 && hasMse && hasDynamicAssets;
|
||||
this.debug("isSupported() returns {0}.", result);
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
DashInjector.prototype.inject = function () {
|
||||
var _this = this;
|
||||
var firstDynamicAsset = _(this.filteredAssets().DynamicVideoAssets).first();
|
||||
var firstThumbnailAsset = _(this.filteredAssets().ThumbnailAssets).first();
|
||||
|
||||
this.debug("Injecting player into element '{0}'.", this.container.id);
|
||||
|
||||
var videoElement = $("<video controls>").attr("width", this.playerWidth).attr("height", this.playerHeight);
|
||||
if (firstThumbnailAsset)
|
||||
videoElement.attr("poster", firstThumbnailAsset.MainFileUrl);
|
||||
videoElement.appendTo(this.container);
|
||||
|
||||
var url = firstDynamicAsset.MpegDashUrl;
|
||||
var context = new Dash.di.DashContext();
|
||||
var player = new MediaPlayer(context);
|
||||
player.startup();
|
||||
|
||||
player.addEventListener("error", function (e) {
|
||||
_this.debug("Error of type '{0}' detected; cleaning up container and faulting this injector.", e.error);
|
||||
|
||||
// TODO: Be a little more selective here, don't fail on any error.
|
||||
_this.fault();
|
||||
});
|
||||
|
||||
player.debug.setLogToBrowserConsole(false);
|
||||
player.attachView(videoElement[0]);
|
||||
player.attachSource(url);
|
||||
player.setAutoPlay(this.autoPlay);
|
||||
};
|
||||
|
||||
DashInjector.prototype.debug = function (message) {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < (arguments.length - 1); _i++) {
|
||||
args[_i] = arguments[_i + 1];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
args[_i - 1] = arguments[_i];
|
||||
}
|
||||
_super.prototype.debug.call(this, "DashInjector: " + message, args);
|
||||
};
|
||||
return DashInjector;
|
||||
})(Injectors.Injector);
|
||||
Injectors.DashInjector = DashInjector;
|
||||
})(VideoPlayer.Injectors || (VideoPlayer.Injectors = {}));
|
||||
var Injectors = VideoPlayer.Injectors;
|
||||
})(MediaServices.VideoPlayer || (MediaServices.VideoPlayer = {}));
|
||||
var VideoPlayer = MediaServices.VideoPlayer;
|
||||
})(Azure.MediaServices || (Azure.MediaServices = {}));
|
||||
var MediaServices = Azure.MediaServices;
|
||||
})(Orchard.Azure || (Orchard.Azure = {}));
|
||||
var Azure = Orchard.Azure;
|
||||
})(Injectors = VideoPlayer.Injectors || (VideoPlayer.Injectors = {}));
|
||||
})(VideoPlayer = MediaServices.VideoPlayer || (MediaServices.VideoPlayer = {}));
|
||||
})(MediaServices = Azure.MediaServices || (Azure.MediaServices = {}));
|
||||
})(Azure = Orchard.Azure || (Orchard.Azure = {}));
|
||||
})(Orchard || (Orchard = {}));
|
||||
//# sourceMappingURL=cloudmedia-videoplayer-injectors-dash.js.map
|
||||
//# sourceMappingURL=cloudmedia-videoplayer-injectors-dash.js.map
|
@ -1 +1 @@
|
||||
{"version":3,"file":"cloudmedia-videoplayer-injectors-dash.js","sourceRoot":"","sources":["cloudmedia-videoplayer-injectors-dash.ts"],"names":["Orchard","Orchard.Azure","Orchard.Azure.MediaServices","Orchard.Azure.MediaServices.VideoPlayer","Orchard.Azure.MediaServices.VideoPlayer.Injectors","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector.constructor","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector.isSupported","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector.inject","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector.debug"],"mappings":"AAAA,4CAA4C;AAC5C,gDAAgD;;;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ACA,CAACA;4BAClCA,MAAMA,CAACA,YAAYA,CAACA,GAAGA,CAACA;4BACxBA,MAAMA,CAACA,WAAWA,CAACA,IAAIA,CAACA,QAAQA,CAACA;wBACrCA,CAACA;;wBAEDH,+BAAAA,UAAaA,OAAeA;4BAAEI,IAAGA,IAAIA;AAAOA,iCAAdA,WAAcA,CAAdA,2BAAcA,EAAdA,IAAcA;gCAAdA,6BAAcA;;4BACxCA,gBAAKA,CAACA,KAAKA,KAACA,OAAAA,gBAAgBA,GAAGA,OAAOA,EAAEA,IAAIA,CAACA;wBACjDA,CAACA;wBACLJ,oBAACA;oBAADA,CAACA,EAnDiCD,kBAAQA,EAmDzCA;oBAnDDA,sCAmDCA;gBACLA,CAACA,yDAAAD;sDAAAA;YAADA,CAACA,iEAAAD;wDAAAA;QAADA,CAACA,qDAAAD;gDAAAA;IAADA,CAACA,yCAAAD;8BAAAA;AAADA,CAACA,6BAAA"}
|
||||
{"version":3,"file":"cloudmedia-videoplayer-injectors-dash.js","sourceRoot":"","sources":["cloudmedia-videoplayer-injectors-dash.ts"],"names":["Orchard","Orchard.Azure","Orchard.Azure.MediaServices","Orchard.Azure.MediaServices.VideoPlayer","Orchard.Azure.MediaServices.VideoPlayer.Injectors","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector.constructor","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector.isSupported","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector.inject","Orchard.Azure.MediaServices.VideoPlayer.Injectors.DashInjector.debug"],"mappings":"AAAA,4CAA4C;AAC5C,gDAAgD;;;;;;;AAEhD,IAAO,OAAO,CAqEb;AArED,WAAO,OAAO;IAACA,IAAAA,KAAKA,CAqEnBA;IArEcA,WAAAA,KAAKA;QAACC,IAAAA,aAAaA,CAqEjCA;QArEoBA,WAAAA,aAAaA;YAACC,IAAAA,WAAWA,CAqE7CA;YArEkCA,WAAAA,WAA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CAACA,CAACA;4BACnCA,MAAMA,CAACA,YAAYA,CAACA,GAAGA,CAACA,CAACA;4BACzBA,MAAMA,CAACA,WAAWA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;wBACtCA,CAACA;wBAEMH,4BAAKA,GAAZA,UAAaA,OAAeA;4BAAEI,cAAcA;iCAAdA,WAAcA,CAAdA,sBAAcA,CAAdA,IAAcA;gCAAdA,6BAAcA;;4BACxCA,gBAAKA,CAACA,KAAKA,YAACA,gBAAgBA,GAAGA,OAAOA,EAAEA,IAAIA,CAACA,CAACA;wBAClDA,CAACA;wBACLJ,mBAACA;oBAADA,CAACA,AAlDDD,EAAkCA,kBAAQA,EAkDzCA;oBAlDYA,sBAAYA,GAAZA,YAkDZA,CAAAA;gBACLA,CAACA,EArE8CD,SAASA,GAATA,qBAASA,KAATA,qBAASA,QAqEvDA;YAADA,CAACA,EArEkCD,WAAWA,GAAXA,yBAAWA,KAAXA,yBAAWA,QAqE7CA;QAADA,CAACA,EArEoBD,aAAaA,GAAbA,mBAAaA,KAAbA,mBAAaA,QAqEjCA;IAADA,CAACA,EArEcD,KAAKA,GAALA,aAAKA,KAALA,aAAKA,QAqEnBA;AAADA,CAACA,EArEM,OAAO,KAAP,OAAO,QAqEb"}
|
@ -23,10 +23,9 @@ module Orchard.Azure.MediaServices.VideoPlayer.Injectors {
|
||||
|
||||
public isSupported(): boolean {
|
||||
var videoElement: HTMLVideoElement = document.createElement("video");
|
||||
var mse: MediaSource = window["MediaSource"] || window["WebKitMediaSource"];
|
||||
|
||||
var hasH264 = videoElement && videoElement.canPlayType && !!videoElement.canPlayType("video/mp4; codecs=\"avc1.42001E, mp4a.40.2\"");
|
||||
var hasMse = mse && mse.isTypeSupported && mse.isTypeSupported("video/mp4; codecs=\"avc1.4d404f\"");
|
||||
var hasMse = MediaSource && MediaSource.isTypeSupported && MediaSource.isTypeSupported("video/mp4; codecs=\"avc1.4d404f\"");
|
||||
var hasDynamicAssets = _(this.filteredAssets().DynamicVideoAssets).any();
|
||||
|
||||
this.debug("Browser supports HTML5 video and the H264 and AAC codecs: {0}", hasH264);
|
||||
|
Loading…
Reference in New Issue
Block a user