Commit c63e9ebf authored by Kirk Shoop's avatar Kirk Shoop

Merge pull request #220 from Dash-Industry-Forum/development

Release dash.js v1.2.0
parents 8f95cc2e e2b7722c
......@@ -27,5 +27,6 @@
"MSMediaKeys",
"MediaKeys",
"Caster",
"TextTrackCue"]
"TextTrackCue",
"HTMLMediaElement"]
}
module.exports = function(grunt) {
grunt.initConfig({
connect: {
default_options: {}
default_options: {},
dev: {
options: {
port: 9999,
keepalive: true
}
}
},
watch: {},
jshint: {
......@@ -110,5 +116,5 @@ module.exports = function(grunt) {
// Define tasks
grunt.registerTask('default', ['jshint','connect','jasmine','uglify']);
grunt.registerTask('default', ['jshint','connect:default_options','jasmine','uglify']);
};
......@@ -23,6 +23,16 @@
{
"name": "Senthil",
"link": "https://github.com/senthil-codr"
},
{
"name": "Brightcove",
"logo": "app/img/brightcove.png",
"link": "https://www.brightcove.com"
},
{
"name": "Fraunhofer Fokus",
"logo": "app/img/fh_fokus.png",
"link": "http://www.fokus.fraunhofer.de/en/fame/index.html"
}
]
}
.github-button {
float: left;
width:170px;
height: 30px;
}
@media screen and (min-width: 0px) and (max-width: 1100px) {
#desktop-streams {
display: none;
......@@ -40,6 +46,10 @@ a:hover {
margin-bottom: 10px;
}
.title-header {
position: relative;
}
.title-header a img {
height: 50px;
}
......@@ -49,6 +59,13 @@ a:hover {
line-height: 50px;
}
.github {
position: absolute;
right: 0px;
top: 50%;
margin-top: -10px;
}
.dash-video-player {
background-color: #000000;
}
......@@ -98,6 +115,71 @@ chart {
overflow: scroll;
}
#manifestInfo {
height: auto;
overflow: auto;
white-space: nowrap;
position: relative;
}
#manifestInfo > div {
overflow: auto;
}
.manifest-info-box {
display: inline-block;
width: 300px;
vertical-align: top;
}
.manifest-info-item:first-child {
width: 600px;
}
.manifest-info-item:first-child span {
padding-left: 300px;
}
.manifest-info-content {
display: inline-block;
width: 100%;
}
.manifest-info-content:nth-of-type(even) {
background-color: #e1edf7;
}
.manifest-nested-info {
}
.manifest-info-content[header]:before {
content: attr(header);
position: absolute;
width: 250px;
color: #428BCA;
background-color: white;
left: 0;
}
.manifest-info-content.manifest-nested-info[header]:before {
padding-left: 20px;
}
.manifest-info-content[header]:nth-of-type(even):before {
background-color: #e1edf7;
}
.manifest-info-content[header="Period"],
.manifest-info-content[header="Period"]:before {
background-color: #e0ffff;
}
.manifest-info-content[header="Representation"],
.manifest-info-content[header="Representation"]:before {
background-color: #f5fffa;
}
#notes {
height: 340px;
max-height: 340px;
......
......@@ -144,6 +144,8 @@ Dash.dependencies.BaseURLExtensions = function () {
findInit = function (data, info) {
var deferred = Q.defer(),
ftyp,
moov,
start,
end,
d = new DataView(data),
......@@ -171,6 +173,12 @@ Dash.dependencies.BaseURLExtensions = function () {
pos += 1;
}
if (type === "ftyp") {
ftyp = pos - 8;
}
if (type === "moov") {
moov = pos - 8;
}
if (type !== "moov") {
pos += size - 8;
}
......@@ -211,15 +219,16 @@ Dash.dependencies.BaseURLExtensions = function () {
deferred.reject("Error loading initialization.");
};
request.open("GET", info.url);
request.open("GET", self.tokenAuthentication.addTokenAsQueryArg(info.url));
request.responseType = "arraybuffer";
request.setRequestHeader("Range", "bytes=" + info.range.start + "-" + info.range.end);
request = self.tokenAuthentication.setTokenInRequestHeader(request);
request.send(null);
} else {
// Case 2
// We have the entire range, so continue.
start = pos - 8;
end = start + size - 1;
start = ftyp === undefined ? moov : ftyp;
end = moov + size - 1;
irange = start + "-" + end;
self.debug.log("Found the initialization. Range: " + irange);
......@@ -273,9 +282,10 @@ Dash.dependencies.BaseURLExtensions = function () {
deferred.reject(request);
};
request.open("GET", info.url);
request.open("GET", self.tokenAuthentication.addTokenAsQueryArg(info.url));
request.responseType = "arraybuffer";
request.setRequestHeader("Range", "bytes=" + info.range.start + "-" + info.range.end);
request = self.tokenAuthentication.setTokenInRequestHeader(request);
request.send(null);
self.debug.log("Perform init search: " + info.url);
......@@ -365,9 +375,10 @@ Dash.dependencies.BaseURLExtensions = function () {
deferred.reject(request);
};
request.open("GET", info.url);
request.open("GET", self.tokenAuthentication.addTokenAsQueryArg(info.url));
request.responseType = "arraybuffer";
request.setRequestHeader("Range", "bytes=" + info.range.start + "-" + info.range.end);
request = self.tokenAuthentication.setTokenInRequestHeader(request);
request.send(null);
} else {
// Case 3
......@@ -498,9 +509,10 @@ Dash.dependencies.BaseURLExtensions = function () {
deferred.reject(request);
};
request.open("GET", info.url);
request.open("GET", self.tokenAuthentication.addTokenAsQueryArg(info.url));
request.responseType = "arraybuffer";
request.setRequestHeader("Range", "bytes=" + info.range.start + "-" + info.range.end);
request = self.tokenAuthentication.setTokenInRequestHeader(request);
request.send(null);
self.debug.log("Perform SIDX load: " + info.url);
......@@ -510,7 +522,7 @@ Dash.dependencies.BaseURLExtensions = function () {
return {
debug: undefined,
errHandler: undefined,
tokenAuthentication:undefined,
loadSegments: loadSegments,
loadInitialization: loadInit,
parseSegments: parseSegments,
......
This diff is collapsed.
This diff is collapsed.
......@@ -252,6 +252,46 @@ Dash.dependencies.DashMetricsExtensions = function () {
currentDroppedFrames = droppedFrames[droppedFramesLastIndex];
return currentDroppedFrames;
},
getCurrentDVRInfo = function (metrics) {
if (metrics === null) {
return null;
}
var dvrInfo = metrics.DVRInfo,
dvrInfoLastIndex,
curentDVRInfo = null;
if (dvrInfo === null || dvrInfo.length <= 0) {
return null;
}
dvrInfoLastIndex = dvrInfo.length - 1;
curentDVRInfo = dvrInfo[dvrInfoLastIndex];
return curentDVRInfo;
},
getCurrentManifestUpdate = function(metrics) {
if (metrics === null) return null;
var manifestUpdate = metrics.ManifestUpdate,
ln,
lastIdx,
currentManifestUpdate;
if (manifestUpdate === null || manifestUpdate.length <= 0) {
return null;
}
ln = manifestUpdate.length;
lastIdx = ln - 1;
currentManifestUpdate = manifestUpdate[lastIdx];
return currentManifestUpdate;
};
return {
......@@ -264,7 +304,9 @@ Dash.dependencies.DashMetricsExtensions = function () {
getCurrentBufferLevel : getCurrentBufferLevel,
getCurrentHttpRequest : getCurrentHttpRequest,
getHttpRequests : getHttpRequests,
getCurrentDroppedFrames : getCurrentDroppedFrames
getCurrentDroppedFrames : getCurrentDroppedFrames,
getCurrentDVRInfo : getCurrentDVRInfo,
getCurrentManifestUpdate: getCurrentManifestUpdate
};
};
......
......@@ -14,7 +14,9 @@
Dash.dependencies.TimelineConverter = function () {
"use strict";
var calcAvailabilityTimeFromPresentationTime = function (presentationTime, mpd, isDynamic, calculateEnd) {
var clientServerTimeShift = 0,
calcAvailabilityTimeFromPresentationTime = function (presentationTime, mpd, isDynamic, calculateEnd) {
var availabilityTime = NaN;
if (calculateEnd) {
......@@ -30,7 +32,7 @@ Dash.dependencies.TimelineConverter = function () {
if (isDynamic) {
availabilityTime = new Date(mpd.availabilityStartTime.getTime() + (presentationTime * 1000));
} else {
// in static mpd, all segments are available at the same time
// in static mpd, all segments are available at the same time
availabilityTime = mpd.availabilityStartTime;
}
}
......@@ -48,37 +50,48 @@ Dash.dependencies.TimelineConverter = function () {
calcPresentationStartTime = function (period) {
var presentationStartTime,
isDynamic;
isDynamic = period.mpd.manifest.type === "dynamic";
isDynamic = period.mpd.manifest.type === "dynamic",
startTimeOffset = parseInt(this.uriQueryFragModel.getURIFragmentData.s);
if (isDynamic) {
presentationStartTime = period.liveEdge;
if (!isNaN(startTimeOffset) && startTimeOffset > 1262304000) {
presentationStartTime = startTimeOffset - (period.mpd.availabilityStartTime.getTime()/1000);
if (presentationStartTime > period.liveEdge ||
presentationStartTime < (period.liveEdge - period.mpd.timeShiftBufferDepth)) {
presentationStartTime = null;
}
}
presentationStartTime = presentationStartTime || period.liveEdge;
} else {
presentationStartTime = period.start;
if (!isNaN(startTimeOffset) && startTimeOffset < period.duration && startTimeOffset >= 0) {
presentationStartTime = startTimeOffset;
}else{
presentationStartTime = period.start;
}
}
return presentationStartTime;
},
calcPresentationTimeFromWallTime = function (wallTime, period, isDynamic) {
var periodAvailabilityStartTime = calcAvailabilityStartTimeFromPresentationTime.call(this, period.start, period.mpd, isDynamic);
return ((wallTime.getTime() - periodAvailabilityStartTime.getTime()) / 1000);
calcPresentationTimeFromWallTime = function (wallTime, period) {
return ((wallTime.getTime() - period.mpd.availabilityStartTime.getTime()) / 1000);
},
calcPresentationTimeFromMediaTime = function (mediaTime, representation) {
var periodStart = representation.adaptation.period.start,
presentationOffset = representation.presentationTimeOffset;
var presentationOffset = representation.presentationTimeOffset;
return (periodStart - presentationOffset) + mediaTime;
return mediaTime - presentationOffset;
},
calcMediaTimeFromPresentationTime = function (presentationTime, representation) {
var periodStart = representation.adaptation.period.start,
presentationOffset = representation.presentationTimeOffset;
var presentationOffset = representation.presentationTimeOffset;
return (periodStart + presentationOffset + presentationTime);
return (presentationOffset + presentationTime);
},
calcWallTimeForSegment = function (segment, isDynamic) {
......@@ -95,9 +108,23 @@ Dash.dependencies.TimelineConverter = function () {
return wallTime;
},
calcActualPresentationTime = function(representation, currentTime, isDynamic) {
var self = this,
periodStart = representation.adaptation.period.start,
availabilityWindow = self.calcSegmentAvailabilityRange(representation, isDynamic),
actualTime;
if ((currentTime >= (availabilityWindow.start + periodStart)) && (currentTime <= (availabilityWindow.end + periodStart))) {
return currentTime;
}
actualTime = Math.max(availabilityWindow.end - representation.adaptation.period.mpd.manifest.minBufferTime * 2, availabilityWindow.start);
return actualTime;
},
calcSegmentAvailabilityRange = function(representation, isDynamic) {
var clientServerTimeShift = representation.adaptation.period.clientServerTimeShift * 1000,
duration = representation.segmentDuration,
var duration = representation.segmentDuration,
start = 0,
end = representation.adaptation.period.duration,
range = {start: start, end: end},
......@@ -106,18 +133,17 @@ Dash.dependencies.TimelineConverter = function () {
if (!isDynamic) return range;
if (!representation.adaptation.period.isClientServerTimeSyncCompleted && representation.segmentAvailabilityRange) {
if ((!representation.adaptation.period.mpd.isClientServerTimeSyncCompleted || isNaN(duration)) && representation.segmentAvailabilityRange) {
return representation.segmentAvailabilityRange;
}
checkTime = representation.adaptation.period.mpd.checkTime;
now = calcPresentationTimeFromWallTime(new Date((new Date().getTime()) + clientServerTimeShift), representation.adaptation.period, isDynamic);
now = calcPresentationTimeFromWallTime(new Date((new Date().getTime()) + clientServerTimeShift), representation.adaptation.period);
//the Media Segment list is further restricted by the CheckTime together with the MPD attribute
// MPD@timeShiftBufferDepth such that only Media Segments for which the sum of the start time of the
// Media Segment and the Period start time falls in the interval [NOW- MPD@timeShiftBufferDepth - @duration, min(CheckTime, NOW)] are included.
start = Math.max((now - representation.adaptation.period.mpd.timeShiftBufferDepth - duration), 0);
checkTime -= duration;
now -= duration;
start = Math.max((now - representation.adaptation.period.mpd.timeShiftBufferDepth), 0);
checkTime += (clientServerTimeShift / 1000);
end = isNaN(checkTime) ? now : Math.min(checkTime, now);
range = {start: start, end: end};
......@@ -125,24 +151,25 @@ Dash.dependencies.TimelineConverter = function () {
},
liveEdgeFound = function(expectedLiveEdge, actualLiveEdge, period) {
if (period.isClientServerTimeSyncCompleted) return;
if (period.mpd.isClientServerTimeSyncCompleted) return;
// the difference between expected and actual live edge time is supposed to be a difference between client
// and server time as well
period.clientServerTimeShift = actualLiveEdge - expectedLiveEdge;
period.isClientServerTimeSyncCompleted = true;
period.mpd.clientServerTimeShift = actualLiveEdge - expectedLiveEdge;
period.mpd.isClientServerTimeSyncCompleted = true;
clientServerTimeShift = period.mpd.clientServerTimeShift * 1000;
},
calcMSETimeOffset = function (representation) {
var periodStart = representation.adaptation.period.start,
presentationOffset = representation.presentationTimeOffset;
var presentationOffset = representation.presentationTimeOffset;
return (periodStart - presentationOffset);
return (-presentationOffset);
};
return {
system: undefined,
debug: undefined,
uriQueryFragModel:undefined,
setup: function() {
this.system.mapHandler("liveEdgeFound", undefined, liveEdgeFound.bind(this));
......@@ -153,6 +180,7 @@ Dash.dependencies.TimelineConverter = function () {
calcPresentationTimeFromWallTime: calcPresentationTimeFromWallTime,
calcPresentationTimeFromMediaTime: calcPresentationTimeFromMediaTime,
calcPresentationStartTime: calcPresentationStartTime,
calcActualPresentationTime: calcActualPresentationTime,
calcMediaTimeFromPresentationTime: calcMediaTimeFromPresentationTime,
calcSegmentAvailabilityRange: calcSegmentAvailabilityRange,
calcWallTimeForSegment: calcWallTimeForSegment,
......
/*
* The copyright in this software is being made available under the BSD License, included below. This software may be subject to other third party and contributor rights, including patent rights, and no such rights are granted under this license.
*
* Copyright (c) 2013, Fraunhofer Fokus
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* • Neither the name of the Digital Primates nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Dash.vo.Event = function () {
"use strict";
this.duration = NaN;
this.presentationTime = NaN;
this.id = NaN;
this.messageData = "";
this.eventStream = null;
this.presentationTimeDelta = NaN; // Specific EMSG Box paramater
};
Dash.vo.Event.prototype = {
constructor: Dash.vo.Event
};
/*
* The copyright in this software is being made available under the BSD License, included below. This software may be subject to other third party and contributor rights, including patent rights, and no such rights are granted under this license.
*
* Copyright (c) 2013, Fraunhofer Fokus
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* • Neither the name of the Digital Primates nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
Dash.vo.EventStream = function () {
"use strict";
this.adaptionSet = null;
this.representation = null;
this.period = null;
this.timescale = 1;
this.value = "";
this.schemeIdUri = "";
};
Dash.vo.EventStream.prototype = {
constructor: Dash.vo.EventStream
};
......@@ -20,6 +20,8 @@ Dash.vo.Mpd = function () {
this.timeShiftBufferDepth = Number.POSITIVE_INFINITY;
this.maxSegmentDuration = Number.POSITIVE_INFINITY;
this.checkTime = NaN;
this.clientServerTimeShift = 0;
this.isClientServerTimeSyncCompleted = false;
};
Dash.vo.Mpd.prototype = {
......
......@@ -19,8 +19,6 @@ Dash.vo.Period = function () {
this.start = NaN;
this.mpd = null;
this.liveEdge = NaN;
this.isClientServerTimeSyncCompleted = false;
this.clientServerTimeShift = 0;
};
Dash.vo.Period.prototype = {
......
This diff is collapsed.
......@@ -31,25 +31,17 @@ MediaPlayer.dependencies.BufferExtensions = function () {
isPlayingAtTopQuality = function() {
var self = this,
deferred = Q.defer(),
audioQuality,
videoQuality,
isAtTop;
Q.when(audioData ? self.abrController.getPlaybackQuality("audio", audioData) : topAudioQualityIndex).then(
function(audioQuality) {
Q.when(videoData ? self.abrController.getPlaybackQuality("video", videoData) : topVideoQualityIndex).then(
function(videoQuality) {
isAtTop = (audioQuality.quality === topAudioQualityIndex) &&
(videoQuality.quality === topVideoQualityIndex);
isAtTop = isAtTop ||
((audioQuality.confidence === MediaPlayer.rules.SwitchRequest.prototype.STRONG) &&
(videoQuality.confidence === MediaPlayer.rules.SwitchRequest.prototype.STRONG));
deferred.resolve(isAtTop);
}
);
}
);
audioQuality = audioData ? self.abrController.getQualityFor("audio") : topAudioQualityIndex;
videoQuality = videoData ? self.abrController.getQualityFor("video") : topVideoQualityIndex;
return deferred.promise;
isAtTop = (audioQuality === topAudioQualityIndex) &&
(videoQuality === topVideoQualityIndex);
return isAtTop;
};
return {
......@@ -119,7 +111,7 @@ MediaPlayer.dependencies.BufferExtensions = function () {
ametrics = self.metricsModel.getReadOnlyMetricsFor("audio"),
isLongFormContent = (duration >= MediaPlayer.dependencies.BufferExtensions.LONG_FORM_CONTENT_DURATION_THRESHOLD),
deferred = Q.defer(),
deferredIsAtTop = null,
isAtTop = false,
requiredBufferLength;
if (self.bufferMax === MediaPlayer.dependencies.BufferExtensions.BUFFER_SIZE_MIN) {
......@@ -133,25 +125,20 @@ MediaPlayer.dependencies.BufferExtensions = function () {
if (!isDynamic) {
if (!waitingForBuffer) {
deferredIsAtTop = isPlayingAtTopQuality.call(self);
isAtTop = isPlayingAtTopQuality.call(self);
}
}
Q.when(deferredIsAtTop).then(
function(isAtTop) {
if (isAtTop) {
currentBufferTarget = isLongFormContent ?
MediaPlayer.dependencies.BufferExtensions.BUFFER_TIME_AT_TOP_QUALITY_LONG_FORM :
MediaPlayer.dependencies.BufferExtensions.BUFFER_TIME_AT_TOP_QUALITY;
}
if (isAtTop) {
currentBufferTarget = isLongFormContent ?
MediaPlayer.dependencies.BufferExtensions.BUFFER_TIME_AT_TOP_QUALITY_LONG_FORM :
MediaPlayer.dependencies.BufferExtensions.BUFFER_TIME_AT_TOP_QUALITY;
}
requiredBufferLength = currentBufferTarget + delay + Math.max(getCurrentHttpRequestLatency.call(self, vmetrics),
getCurrentHttpRequestLatency.call(self, ametrics));
requiredBufferLength = currentBufferTarget + delay + Math.max(getCurrentHttpRequestLatency.call(self, vmetrics),
getCurrentHttpRequestLatency.call(self, ametrics));
deferred.resolve(requiredBufferLength);
}
);
deferred.resolve(requiredBufferLength);
} else {
deferred.reject("invalid bufferMax value: " + self.bufferMax);
}
......
......@@ -40,8 +40,8 @@ MediaPlayer.utils.Capabilities.prototype = {
supportsCodec: function (element, codec) {
"use strict";
if (!(element instanceof HTMLVideoElement)) {
throw "element must be of type HTMLVideoElement.";
if (!(element instanceof HTMLMediaElement)) {
throw "element must be of type HTMLMediaElement.";
}
var canPlay = element.canPlayType(codec);
......
......@@ -20,17 +20,20 @@ MediaPlayer.di.Context = function () {
this.system.autoMapOutlets = true;
this.system.mapSingleton('debug', MediaPlayer.utils.Debug);
this.system.mapSingleton('tokenAuthentication', MediaPlayer.utils.TokenAuthentication);
this.system.mapSingleton('eventBus', MediaPlayer.utils.EventBus);
this.system.mapSingleton('capabilities', MediaPlayer.utils.Capabilities);
this.system.mapSingleton('textTrackExtensions', MediaPlayer.utils.TextTrackExtensions);
this.system.mapSingleton('vttParser', MediaPlayer.utils.VTTParser);
this.system.mapSingleton('ttmlParser', MediaPlayer.utils.TTMLParser);
this.system.mapClass('videoModel', MediaPlayer.models.VideoModel);
this.system.mapSingleton('manifestModel', MediaPlayer.models.ManifestModel);
this.system.mapSingleton('metricsModel', MediaPlayer.models.MetricsModel);
this.system.mapSingleton('uriQueryFragModel', MediaPlayer.models.URIQueryAndFragmentModel);
this.system.mapClass('protectionModel', MediaPlayer.models.ProtectionModel);
this.system.mapSingleton('textVTTSourceBuffer', MediaPlayer.dependencies.TextVTTSourceBuffer);
this.system.mapSingleton('textSourceBuffer', MediaPlayer.dependencies.TextSourceBuffer);
this.system.mapSingleton('mediaSourceExt', MediaPlayer.dependencies.MediaSourceExtensions);
this.system.mapSingleton('sourceBufferExt', MediaPlayer.dependencies.SourceBufferExtensions);
this.system.mapSingleton('bufferExt', MediaPlayer.dependencies.BufferExtensions);
......@@ -47,10 +50,11 @@ MediaPlayer.di.Context = function () {
this.system.mapClass('limitSwitchesRule', MediaPlayer.rules.LimitSwitchesRule);
this.system.mapClass('abrRulesCollection', MediaPlayer.rules.BaseRulesCollection);
this.system.mapClass('eventController', MediaPlayer.dependencies.EventController);
this.system.mapClass('textController', MediaPlayer.dependencies.TextController);
this.system.mapClass('bufferController', MediaPlayer.dependencies.BufferController);
this.system.mapClass('manifestLoader', MediaPlayer.dependencies.ManifestLoader);
this.system.mapClass('manifestUpdater', MediaPlayer.dependencies.ManifestUpdater);
this.system.mapSingleton('manifestUpdater', MediaPlayer.dependencies.ManifestUpdater);
this.system.mapClass('fragmentController', MediaPlayer.dependencies.FragmentController);
this.system.mapClass('fragmentLoader', MediaPlayer.dependencies.FragmentLoader);
this.system.mapClass('fragmentModel', MediaPlayer.dependencies.FragmentModel);
......
......@@ -45,6 +45,14 @@ MediaPlayer.dependencies.ErrorHandler = function () {
});
},
closedCaptionsError: function (message, id, ccContent) {
this.eventBus.dispatchEvent({
type: "error",
error: "cc",
event: {message: message, id: id, cc: ccContent}