dasha 3.0.2 → 3.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/dash.js +6 -10
  2. package/package.json +1 -1
package/lib/dash.js CHANGED
@@ -56,16 +56,12 @@ const combineGetters = (representation, adaptationSet) => {
56
56
  };
57
57
 
58
58
  const parseBaseUrl = (manifestUrl, mpd, period, representation) => {
59
- let manifestBaseUrl = mpd.getBaseUrl();
60
- if (!manifestBaseUrl) manifestBaseUrl = manifestUrl;
61
- else if (!manifestBaseUrl.startsWith('https://'))
62
- manifestBaseUrl = new URL(manifestBaseUrl, manifestUrl).toString();
63
- const periodBaseUrl = new URL(period.getBaseUrl() || '', manifestBaseUrl).toString();
64
- const representationBaseUrl = new URL(
65
- representation.getBaseUrl() || '',
66
- periodBaseUrl
67
- ).toString();
68
- return representationBaseUrl;
59
+ let base = mpd.getBaseUrl();
60
+ if (!base) base = manifestUrl;
61
+ else if (!base.startsWith('https://')) base = new URL(base, manifestUrl).toString();
62
+ if (!!period.getBaseUrl() || !!base) base = new URL(period.getBaseUrl() || '', base).toString();
63
+ const baseUrl = new URL(representation.getBaseUrl() || '', base).toString();
64
+ return baseUrl;
69
65
  };
70
66
 
71
67
  const parseContentTypes = (representation) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dasha",
3
- "version": "3.0.2",
3
+ "version": "3.0.3",
4
4
  "author": "Vitaly Gashkov <vitalygashkov@vk.com>",
5
5
  "description": "Parser for MPEG-DASH & HLS manifests",
6
6
  "license": "AGPL-3.0",