From 294406b3be575fe2936ead842ade168f40833a80 Mon Sep 17 00:00:00 2001 From: Bertrand Berthelot Date: Thu, 28 May 2020 09:09:37 +0200 Subject: [PATCH] Add protocol in stream's manifestInfo in order to enable protocol detection once stream is loaded (to distinguish DASH from MSS streams) (#3266) --- index.d.ts | 3 ++- src/dash/DashAdapter.js | 1 + src/dash/parser/DashParser.js | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 3285440a01..a2da62d844 100644 --- a/index.d.ts +++ b/index.d.ts @@ -800,6 +800,7 @@ declare namespace dashjs { loadedTime: Date; maxFragmentDuration: number; minBufferTime: number; + protocol?: string; } export class StreamInfo { @@ -807,7 +808,7 @@ declare namespace dashjs { index: number; start: number; duration: number; - manifestInfo: object; + manifestInfo: IManifestInfo; isLast: boolean; } diff --git a/src/dash/DashAdapter.js b/src/dash/DashAdapter.js index cee42a7208..a0c1526546 100644 --- a/src/dash/DashAdapter.js +++ b/src/dash/DashAdapter.js @@ -586,6 +586,7 @@ function DashAdapter() { manifestInfo.duration = dashManifestModel.getDuration(mpd.manifest); manifestInfo.isDynamic = dashManifestModel.getIsDynamic(mpd.manifest); manifestInfo.serviceDescriptions = dashManifestModel.getServiceDescriptions(mpd.manifest); + manifestInfo.protocol = mpd.manifest.protocol; return manifestInfo; } diff --git a/src/dash/parser/DashParser.js b/src/dash/parser/DashParser.js index 7b8497e436..22d3c8acd0 100644 --- a/src/dash/parser/DashParser.js +++ b/src/dash/parser/DashParser.js @@ -99,6 +99,8 @@ function DashParser() { const ironedTime = window.performance.now(); logger.info('Parsing complete: ( xml2json: ' + (jsonTime - startTime).toPrecision(3) + 'ms, objectiron: ' + (ironedTime - jsonTime).toPrecision(3) + 'ms, total: ' + ((ironedTime - startTime) / 1000).toPrecision(3) + 's)'); + manifest.protocol = 'DASH'; + return manifest; }