Expand player stats and track metadata

Visible changes:
 - Add loadLatency stat
 - Add mimeType to tracks
 - Track state changes (buffering, playing, paused, ended)

Internal changes:
 - Track switchHistory, playTime, bufferingTime in private Stats struct
 - Remove dead timer code

Change-Id: I4566373251b9876b0d4f762a9d77aa50aea8ed00
This commit is contained in:
Joey Parrish
2017-01-17 12:57:42 -08:00
parent c391be5012
commit 4d5e668583
8 changed files with 302 additions and 147 deletions
+5
View File
@@ -231,6 +231,9 @@ shaka.util.StreamUtils.getVariantTracks =
if (codecs != '') codecs += ', ';
codecs += variant.audio.codecs;
}
var mimeType = null;
if (variant.video) mimeType = variant.video.mimeType;
else if (variant.audio) mimeType = variant.audio.mimeType;
return {
id: variant.id,
@@ -242,6 +245,7 @@ shaka.util.StreamUtils.getVariantTracks =
width: variant.video ? variant.video.width : null,
height: variant.video ? variant.video.height : null,
frameRate: variant.video ? variant.video.frameRate : undefined,
mimeType: mimeType,
codecs: codecs
};
});
@@ -265,6 +269,7 @@ shaka.util.StreamUtils.getTextTracks = function(period, activeStream) {
type: 'text',
language: stream.language,
kind: stream.kind,
mimeType: stream.mimeType,
codecs: stream.codecs || null
};
});