shaka-player
Advanced tools
Comparing version 2.3.0 to 2.3.1
This directory contains the scripts used to build and test Shaka Player. These | ||
scripts can run on any platform that supports python v2.7 and JRE 7+. | ||
scripts can run on any platform that supports python v2.7 and JRE 8+. | ||
@@ -4,0 +4,0 @@ * `all.py` simply runs `gendeps.py`, `check.py`, and `build.py`. Will forward |
@@ -206,7 +206,10 @@ /** | ||
// Use the custom fields. | ||
var licenseServerUri = document.getElementById('licenseServerInput').value; | ||
var licenseServers = {}; | ||
commonDrmSystems.forEach(function(system) { | ||
licenseServers[system] = | ||
document.getElementById('licenseServerInput').value; | ||
}); | ||
if (licenseServerUri) { | ||
commonDrmSystems.forEach(function(system) { | ||
licenseServers[system] = licenseServerUri; | ||
}); | ||
} | ||
asset = /** @type {shakaAssets.AssetInfo} */ ({ | ||
@@ -213,0 +216,0 @@ manifestUri: document.getElementById('manifestInput').value, |
@@ -0,1 +1,2 @@ | ||
// vim: foldmethod=marker:foldmarker={{{,}}} | ||
/** | ||
@@ -261,3 +262,3 @@ * @license | ||
name: 'Angel One (multicodec, multilingual)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd', // eslint-disable-line max-len | ||
@@ -278,3 +279,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Angel One (multicodec, multilingual, Widevine)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one-widevine/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one-widevine/dash.mpd', // eslint-disable-line max-len | ||
@@ -299,3 +300,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Angel One (multicodec, multilingual, ClearKey server)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one-clearkey/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one-clearkey/dash.mpd', // eslint-disable-line max-len | ||
@@ -315,3 +316,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
licenseServers: { | ||
'org.w3.clearkey': '//cwip-shaka-proxy.appspot.com/clearkey?_u3wDe7erb7v8Lqt8A3QDQ=ABEiM0RVZneImaq7zN3u_w' // gjslint: disable=110 | ||
'org.w3.clearkey': '//cwip-shaka-proxy.appspot.com/clearkey?_u3wDe7erb7v8Lqt8A3QDQ=ABEiM0RVZneImaq7zN3u_w' // eslint-disable-line max-len | ||
} | ||
@@ -321,3 +322,3 @@ }, | ||
name: 'Angel One (HLS, MP4, multilingual)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one-hls/hls.m3u8', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one-hls/hls.m3u8', // eslint-disable-line max-len | ||
@@ -335,3 +336,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Angel One (HLS, MP4, multilingual, Widevine)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one-widevine-hls/hls.m3u8', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/angel-one-widevine-hls/hls.m3u8', // eslint-disable-line max-len | ||
@@ -353,3 +354,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Sintel 4k (multicodec)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel/dash.mpd', // eslint-disable-line max-len | ||
@@ -371,3 +372,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Sintel w/ trick mode (MP4 only, 720p)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-trickplay/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-trickplay/dash.mpd', // eslint-disable-line max-len | ||
@@ -388,3 +389,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Sintel 4k (WebM only)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-webm-only/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-webm-only/dash.mpd', // eslint-disable-line max-len | ||
// NOTE: hanging in Firefox | ||
@@ -407,3 +408,3 @@ // https://bugzilla.mozilla.org/show_bug.cgi?id=1291451 | ||
name: 'Sintel 4k (MP4 only)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-mp4-only/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-mp4-only/dash.mpd', // eslint-disable-line max-len | ||
@@ -424,3 +425,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Sintel 4k (multicodec, Widevine)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-widevine/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-widevine/dash.mpd', // eslint-disable-line max-len | ||
@@ -447,3 +448,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Sintel 4k (multicodec, VTT in MP4)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-mp4-wvtt/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/sintel-mp4-wvtt/dash.mpd', // eslint-disable-line max-len | ||
@@ -466,3 +467,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Heliocentrism (multicodec, multiperiod)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/heliocentrism/heliocentrism.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/heliocentrism/heliocentrism.mpd', // eslint-disable-line max-len | ||
@@ -481,3 +482,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Heliocentrism (multicodec, multiperiod, xlink)', | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/heliocentrism-xlink/heliocentrism.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/heliocentrism-xlink/heliocentrism.mpd', // eslint-disable-line max-len | ||
@@ -496,3 +497,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
{ | ||
name: '"Dig the Uke" by Stefan Kartenberg (audio only, multicodec)', // gjslint: disable=110 | ||
name: '"Dig the Uke" by Stefan Kartenberg (audio only, multicodec)', // eslint-disable-line max-len | ||
// From: http://dig.ccmixter.org/files/JeffSpeed68/53327 | ||
@@ -502,3 +503,3 @@ // Licensed under Creative Commons BY-NC 3.0. | ||
// http://creativecommons.org/licenses/by-nc/3.0/ | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/dig-the-uke-clear/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/dig-the-uke-clear/dash.mpd', // eslint-disable-line max-len | ||
@@ -515,3 +516,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
{ | ||
name: '"Dig the Uke" by Stefan Kartenberg (audio only, multicodec, Widevine)', // gjslint: disable=110 | ||
name: '"Dig the Uke" by Stefan Kartenberg (audio only, multicodec, Widevine)', // eslint-disable-line max-len | ||
// From: http://dig.ccmixter.org/files/JeffSpeed68/53327 | ||
@@ -521,3 +522,3 @@ // Licensed under Creative Commons BY-NC 3.0. | ||
// http://creativecommons.org/licenses/by-nc/3.0/ | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/dig-the-uke/dash.mpd', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-demo-assets/dig-the-uke/dash.mpd', // eslint-disable-line max-len | ||
@@ -568,3 +569,3 @@ encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
name: 'Shaka Player History (live, HLS)', | ||
manifestUri: '//storage.googleapis.com/shaka-live-assets/player-source.m3u8', // gjslint: disable=110 | ||
manifestUri: '//storage.googleapis.com/shaka-live-assets/player-source.m3u8', // eslint-disable-line max-len | ||
encoder: shakaAssets.Encoder.SHAKA_PACKAGER, | ||
@@ -586,3 +587,3 @@ source: shakaAssets.Source.SHAKA, | ||
name: 'Multi-DRM', | ||
manifestUri: '//media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest.mpd', // gjslint: disable=110 | ||
manifestUri: '//media.axprod.net/TestVectors/v7-MultiDRM-SingleKey/Manifest.mpd', // eslint-disable-line max-len | ||
@@ -606,7 +607,7 @@ encoder: shakaAssets.Encoder.AXINOM, | ||
licenseServers: { | ||
'com.widevine.alpha': '//drm-widevine-licensing.axtest.net/AcquireLicense', // gjslint: disable=110 | ||
'com.microsoft.playready': '//drm-playready-licensing.axtest.net/AcquireLicense' // gjslint: disable=110 | ||
'com.widevine.alpha': '//drm-widevine-licensing.axtest.net/AcquireLicense', // eslint-disable-line max-len | ||
'com.microsoft.playready': '//drm-playready-licensing.axtest.net/AcquireLicense' // eslint-disable-line max-len | ||
}, | ||
licenseRequestHeaders: { | ||
'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.4lWwW46k-oWcah8oN18LPj5OLS5ZU-_AQv7fe0JhNjA' // gjslint: disable=110 | ||
'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiOWViNDA1MGQtZTQ0Yi00ODAyLTkzMmUtMjdkNzUwODNlMjY2IiwiZW5jcnlwdGVkX2tleSI6ImxLM09qSExZVzI0Y3Iya3RSNzRmbnc9PSJ9XX19.4lWwW46k-oWcah8oN18LPj5OLS5ZU-_AQv7fe0JhNjA' // eslint-disable-line max-len | ||
} | ||
@@ -616,3 +617,3 @@ }, | ||
name: 'Multi-DRM, multi-key', | ||
manifestUri: '//media.axprod.net/TestVectors/v7-MultiDRM-MultiKey/Manifest.mpd', // gjslint: disable=110 | ||
manifestUri: '//media.axprod.net/TestVectors/v7-MultiDRM-MultiKey/Manifest.mpd', // eslint-disable-line max-len | ||
@@ -637,7 +638,7 @@ encoder: shakaAssets.Encoder.AXINOM, | ||
licenseServers: { | ||
'com.widevine.alpha': '//drm-widevine-licensing.axtest.net/AcquireLicense', // gjslint: disable=110 | ||
'com.microsoft.playready': '//drm-playready-licensing.axtest.net/AcquireLicense' // gjslint: disable=110 | ||
'com.widevine.alpha': '//drm-widevine-licensing.axtest.net/AcquireLicense', // eslint-disable-line max-len | ||
'com.microsoft.playready': '//drm-playready-licensing.axtest.net/AcquireLicense' // eslint-disable-line max-len | ||
}, | ||
licenseRequestHeaders: { | ||
'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiODAzOTliZjUtOGEyMS00MDE0LTgwNTMtZTI3ZTc0OGU5OGMwIiwiZW5jcnlwdGVkX2tleSI6ImxpTkpxVmFZa05oK01LY3hKRms3SWc9PSJ9LHsiaWQiOiI5MDk1M2UwOS02Y2IyLTQ5YTMtYTI2MC03YTVmZWZlYWQ0OTkiLCJlbmNyeXB0ZWRfa2V5Ijoia1l0SEh2cnJmQ01lVmRKNkxrYmtuZz09In0seyJpZCI6IjBlNGRhOTJiLWQwZTgtNGE2Ni04YzNmLWMyNWE5N2ViNjUzMiIsImVuY3J5cHRlZF9rZXkiOiI3dzdOWkhITE1nSjRtUUtFSzVMVE1RPT0ifSx7ImlkIjoiNTg1ZjIzM2YtMzA3Mi00NmYxLTlmYTQtNmRjMjJjNjZhMDE0IiwiZW5jcnlwdGVkX2tleSI6IkFjNFVVbVl0Qko1blBROU4xNXJjM2c9PSJ9LHsiaWQiOiI0MjIyYmQ3OC1iYzQ1LTQxYmYtYjYzZS02ZjgxNGRjMzkxZGYiLCJlbmNyeXB0ZWRfa2V5IjoiTzZGTzBmcVNXb3BwN2JqYy9ENGxNQT09In1dfX0.uF6YlKAREOmbniAeYiH070HSJhV0YS7zSKjlCtiDR5Y' // gjslint: disable=110 | ||
'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiODAzOTliZjUtOGEyMS00MDE0LTgwNTMtZTI3ZTc0OGU5OGMwIiwiZW5jcnlwdGVkX2tleSI6ImxpTkpxVmFZa05oK01LY3hKRms3SWc9PSJ9LHsiaWQiOiI5MDk1M2UwOS02Y2IyLTQ5YTMtYTI2MC03YTVmZWZlYWQ0OTkiLCJlbmNyeXB0ZWRfa2V5Ijoia1l0SEh2cnJmQ01lVmRKNkxrYmtuZz09In0seyJpZCI6IjBlNGRhOTJiLWQwZTgtNGE2Ni04YzNmLWMyNWE5N2ViNjUzMiIsImVuY3J5cHRlZF9rZXkiOiI3dzdOWkhITE1nSjRtUUtFSzVMVE1RPT0ifSx7ImlkIjoiNTg1ZjIzM2YtMzA3Mi00NmYxLTlmYTQtNmRjMjJjNjZhMDE0IiwiZW5jcnlwdGVkX2tleSI6IkFjNFVVbVl0Qko1blBROU4xNXJjM2c9PSJ9LHsiaWQiOiI0MjIyYmQ3OC1iYzQ1LTQxYmYtYjYzZS02ZjgxNGRjMzkxZGYiLCJlbmNyeXB0ZWRfa2V5IjoiTzZGTzBmcVNXb3BwN2JqYy9ENGxNQT09In1dfX0.uF6YlKAREOmbniAeYiH070HSJhV0YS7zSKjlCtiDR5Y' // eslint-disable-line max-len | ||
} | ||
@@ -647,3 +648,3 @@ }, | ||
name: 'Multi-DRM, multi-key, multi-Period', | ||
manifestUri: '//media.axprod.net/TestVectors/v7-MultiDRM-MultiKey-MultiPeriod/Manifest.mpd', // gjslint: disable=110 | ||
manifestUri: '//media.axprod.net/TestVectors/v7-MultiDRM-MultiKey-MultiPeriod/Manifest.mpd', // eslint-disable-line max-len | ||
@@ -669,7 +670,7 @@ encoder: shakaAssets.Encoder.AXINOM, | ||
licenseServers: { | ||
'com.widevine.alpha': '//drm-widevine-licensing.axtest.net/AcquireLicense', // gjslint: disable=110 | ||
'com.microsoft.playready': '//drm-playready-licensing.axtest.net/AcquireLicense' // gjslint: disable=110 | ||
'com.widevine.alpha': '//drm-widevine-licensing.axtest.net/AcquireLicense', // eslint-disable-line max-len | ||
'com.microsoft.playready': '//drm-playready-licensing.axtest.net/AcquireLicense' // eslint-disable-line max-len | ||
}, | ||
licenseRequestHeaders: { | ||
'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiMDg3Mjc4NmUtZjllNy00NjVmLWEzYTItNGU1YjBlZjhmYTQ1IiwiZW5jcnlwdGVkX2tleSI6IlB3NitlRVlOY3ZqWWJmc2gzWDNmbWc9PSJ9LHsiaWQiOiJjMTRmMDcwOS1mMmI5LTQ0MjctOTE2Yi02MWI1MjU4NjUwNmEiLCJlbmNyeXB0ZWRfa2V5IjoiLzErZk5paDM4bXFSdjR5Y1l6bnQvdz09In0seyJpZCI6IjhiMDI5ZTUxLWQ1NmEtNDRiZC05MTBmLWQ0YjVmZDkwZmJhMiIsImVuY3J5cHRlZF9rZXkiOiJrcTBKdVpFanBGTjhzYVRtdDU2ME9nPT0ifSx7ImlkIjoiMmQ2ZTkzODctNjBjYS00MTQ1LWFlYzItYzQwODM3YjRiMDI2IiwiZW5jcnlwdGVkX2tleSI6IlRjUlFlQld4RW9IT0tIcmFkNFNlVlE9PSJ9LHsiaWQiOiJkZTAyZjA3Zi1hMDk4LTRlZTAtYjU1Ni05MDdjMGQxN2ZiYmMiLCJlbmNyeXB0ZWRfa2V5IjoicG9lbmNTN0dnbWVHRmVvSjZQRUFUUT09In0seyJpZCI6IjkxNGU2OWY0LTBhYjMtNDUzNC05ZTlmLTk4NTM2MTVlMjZmNiIsImVuY3J5cHRlZF9rZXkiOiJlaUkvTXNsbHJRNHdDbFJUL0xObUNBPT0ifSx7ImlkIjoiZGE0NDQ1YzItZGI1ZS00OGVmLWIwOTYtM2VmMzQ3YjE2YzdmIiwiZW5jcnlwdGVkX2tleSI6IjJ3K3pkdnFycERWM3hSMGJKeTR1Z3c9PSJ9LHsiaWQiOiIyOWYwNWU4Zi1hMWFlLTQ2ZTQtODBlOS0yMmRjZDQ0Y2Q3YTEiLCJlbmNyeXB0ZWRfa2V5IjoiL3hsU0hweHdxdTNnby9nbHBtU2dhUT09In0seyJpZCI6IjY5ZmU3MDc3LWRhZGQtNGI1NS05NmNkLWMzZWRiMzk5MTg1MyIsImVuY3J5cHRlZF9rZXkiOiJ6dTZpdXpOMnBzaTBaU3hRaUFUa1JRPT0ifV19fQ.BXr93Et1krYMVs-CUnf7F3ywJWFRtxYdkR7Qn4w3-to' // gjslint: disable=110 | ||
'X-AxDRM-Message': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ2ZXJzaW9uIjoxLCJjb21fa2V5X2lkIjoiYjMzNjRlYjUtNTFmNi00YWUzLThjOTgtMzNjZWQ1ZTMxYzc4IiwibWVzc2FnZSI6eyJ0eXBlIjoiZW50aXRsZW1lbnRfbWVzc2FnZSIsImtleXMiOlt7ImlkIjoiMDg3Mjc4NmUtZjllNy00NjVmLWEzYTItNGU1YjBlZjhmYTQ1IiwiZW5jcnlwdGVkX2tleSI6IlB3NitlRVlOY3ZqWWJmc2gzWDNmbWc9PSJ9LHsiaWQiOiJjMTRmMDcwOS1mMmI5LTQ0MjctOTE2Yi02MWI1MjU4NjUwNmEiLCJlbmNyeXB0ZWRfa2V5IjoiLzErZk5paDM4bXFSdjR5Y1l6bnQvdz09In0seyJpZCI6IjhiMDI5ZTUxLWQ1NmEtNDRiZC05MTBmLWQ0YjVmZDkwZmJhMiIsImVuY3J5cHRlZF9rZXkiOiJrcTBKdVpFanBGTjhzYVRtdDU2ME9nPT0ifSx7ImlkIjoiMmQ2ZTkzODctNjBjYS00MTQ1LWFlYzItYzQwODM3YjRiMDI2IiwiZW5jcnlwdGVkX2tleSI6IlRjUlFlQld4RW9IT0tIcmFkNFNlVlE9PSJ9LHsiaWQiOiJkZTAyZjA3Zi1hMDk4LTRlZTAtYjU1Ni05MDdjMGQxN2ZiYmMiLCJlbmNyeXB0ZWRfa2V5IjoicG9lbmNTN0dnbWVHRmVvSjZQRUFUUT09In0seyJpZCI6IjkxNGU2OWY0LTBhYjMtNDUzNC05ZTlmLTk4NTM2MTVlMjZmNiIsImVuY3J5cHRlZF9rZXkiOiJlaUkvTXNsbHJRNHdDbFJUL0xObUNBPT0ifSx7ImlkIjoiZGE0NDQ1YzItZGI1ZS00OGVmLWIwOTYtM2VmMzQ3YjE2YzdmIiwiZW5jcnlwdGVkX2tleSI6IjJ3K3pkdnFycERWM3hSMGJKeTR1Z3c9PSJ9LHsiaWQiOiIyOWYwNWU4Zi1hMWFlLTQ2ZTQtODBlOS0yMmRjZDQ0Y2Q3YTEiLCJlbmNyeXB0ZWRfa2V5IjoiL3hsU0hweHdxdTNnby9nbHBtU2dhUT09In0seyJpZCI6IjY5ZmU3MDc3LWRhZGQtNGI1NS05NmNkLWMzZWRiMzk5MTg1MyIsImVuY3J5cHRlZF9rZXkiOiJ6dTZpdXpOMnBzaTBaU3hRaUFUa1JRPT0ifV19fQ.BXr93Et1krYMVs-CUnf7F3ywJWFRtxYdkR7Qn4w3-to' // eslint-disable-line max-len | ||
} | ||
@@ -696,3 +697,3 @@ }, | ||
name: 'Clear, multi-Period', | ||
manifestUri: '//media.axprod.net/TestVectors/v7-Clear/Manifest_MultiPeriod.mpd', // gjslint: disable=110 | ||
manifestUri: '//media.axprod.net/TestVectors/v7-Clear/Manifest_MultiPeriod.mpd', // eslint-disable-line max-len | ||
@@ -719,3 +720,3 @@ encoder: shakaAssets.Encoder.AXINOM, | ||
name: 'Tears of Steel', | ||
manifestUri: '//demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/.mpd', // gjslint: disable=110 | ||
manifestUri: '//demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/.mpd', // eslint-disable-line max-len | ||
@@ -734,3 +735,3 @@ encoder: shakaAssets.Encoder.UNIFIED_STREAMING, | ||
name: 'Tears of Steel (Widevine)', | ||
manifestUri: '//demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-dash-widevine.ism/.mpd', // gjslint: disable=110 | ||
manifestUri: '//demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-dash-widevine.ism/.mpd', // eslint-disable-line max-len | ||
@@ -758,3 +759,3 @@ encoder: shakaAssets.Encoder.UNIFIED_STREAMING, | ||
name: 'Tears of Steel (PlayReady)', | ||
manifestUri: '//demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-dash-playready.ism/.mpd', // gjslint: disable=110 | ||
manifestUri: '//demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-dash-playready.ism/.mpd', // eslint-disable-line max-len | ||
@@ -777,3 +778,3 @@ encoder: shakaAssets.Encoder.UNIFIED_STREAMING, | ||
licenseServers: { | ||
'com.microsoft.playready': '//test.playready.microsoft.com/service/rightsmanager.asmx?PlayRight=1&UseSimpleNonPersistentLicense=1' // gjslint: disable=110 | ||
'com.microsoft.playready': '//test.playready.microsoft.com/service/rightsmanager.asmx?PlayRight=1&UseSimpleNonPersistentLicense=1' // eslint-disable-line max-len | ||
} | ||
@@ -783,3 +784,3 @@ }, | ||
name: 'Tears of Steel (subtitles)', | ||
manifestUri: '//demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-ru.ism/.mpd', // gjslint: disable=110 | ||
manifestUri: '//demo.unified-streaming.com/video/tears-of-steel/tears-of-steel-ru.ism/.mpd', // eslint-disable-line max-len | ||
@@ -806,3 +807,3 @@ encoder: shakaAssets.Encoder.UNIFIED_STREAMING, | ||
name: 'Big Buck Bunny', | ||
manifestUri: '//dash.edgesuite.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd', // gjslint: disable=110 | ||
manifestUri: '//dash.edgesuite.net/dash264/TestCases/1c/qualcomm/2/MultiRate.mpd', // eslint-disable-line max-len | ||
@@ -845,3 +846,3 @@ encoder: shakaAssets.Encoder.UNKNOWN, | ||
name: 'Live sim (multi-period)', | ||
manifestUri: '//vm2.dashif.org/livesim/utc_head/periods_20/testpic_2s/Manifest.mpd', // gjslint: disable=110 | ||
manifestUri: '//vm2.dashif.org/livesim/utc_head/periods_20/testpic_2s/Manifest.mpd', // eslint-disable-line max-len | ||
@@ -864,3 +865,3 @@ encoder: shakaAssets.Encoder.UNKNOWN, | ||
name: 'Big Buck Bunny (Live)', | ||
manifestUri: '//wowzaec2demo.streamlock.net/live/bigbuckbunny/manifest_mpm4sav_mvtime.mpd', // gjslint: disable=110 | ||
manifestUri: '//wowzaec2demo.streamlock.net/live/bigbuckbunny/manifest_mpm4sav_mvtime.mpd', // eslint-disable-line max-len | ||
@@ -883,3 +884,3 @@ encoder: shakaAssets.Encoder.WOWZA, | ||
name: 'Art of Motion (DASH)', | ||
manifestUri: '//bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd', // gjslint: disable=110 | ||
manifestUri: '//bitdash-a.akamaihd.net/content/MI201109210084_1/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd', // eslint-disable-line max-len | ||
@@ -897,3 +898,3 @@ encoder: shakaAssets.Encoder.BITCODIN, | ||
name: 'Art of Motion (HLS, TS)', | ||
manifestUri: '//bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8', // gjslint: disable=110 | ||
manifestUri: '//bitdash-a.akamaihd.net/content/MI201109210084_1/m3u8s/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.m3u8', // eslint-disable-line max-len | ||
@@ -929,3 +930,3 @@ encoder: shakaAssets.Encoder.BITCODIN, | ||
name: 'Big Buck Bunny', | ||
manifestUri: '//video.wmspanel.com/local/raw/BigBuckBunny_320x180.mp4/manifest.mpd', // gjslint: disable=110 | ||
manifestUri: '//video.wmspanel.com/local/raw/BigBuckBunny_320x180.mp4/manifest.mpd', // eslint-disable-line max-len | ||
// As of 2017-08-04, there is a common name mismatch error with this site's | ||
@@ -949,3 +950,3 @@ // SSL certificate. See https://github.com/google/shaka-player/issues/955 | ||
name: 'Azure Trailer', | ||
manifestUri: '//amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest(format=mpd-time-csf)', // gjslint: disable=110 | ||
manifestUri: '//amssamples.streaming.mediaservices.windows.net/91492735-c523-432b-ba01-faba6c2206a2/AzureMediaServicesPromo.ism/manifest(format=mpd-time-csf)', // eslint-disable-line max-len | ||
@@ -962,3 +963,3 @@ encoder: shakaAssets.Encoder.AZURE_MEDIA_SERVICES, | ||
name: 'Big Buck Bunny', | ||
manifestUri: '//amssamples.streaming.mediaservices.windows.net/622b189f-ec39-43f2-93a2-201ac4e31ce1/BigBuckBunny.ism/manifest(format=mpd-time-csf)', // gjslint: disable=110 | ||
manifestUri: '//amssamples.streaming.mediaservices.windows.net/622b189f-ec39-43f2-93a2-201ac4e31ce1/BigBuckBunny.ism/manifest(format=mpd-time-csf)', // eslint-disable-line max-len | ||
// NOTE: License servers are timing out as of 2016-03-23. | ||
@@ -980,4 +981,4 @@ // NOTE: Still timing out as of 2016-08-02. | ||
licenseServers: { | ||
'com.widevine.alpha': '//amssamples.keydelivery.mediaservices.windows.net/Widevine/?KID=1ab45440-532c-4399-94dc-5c5ad9584bac', // gjslint: disable=110 | ||
'com.microsoft.playready': '//amssamples.keydelivery.mediaservices.windows.net/PlayReady/' // gjslint: disable=110 | ||
'com.widevine.alpha': '//amssamples.keydelivery.mediaservices.windows.net/Widevine/?KID=1ab45440-532c-4399-94dc-5c5ad9584bac', // eslint-disable-line max-len | ||
'com.microsoft.playready': '//amssamples.keydelivery.mediaservices.windows.net/PlayReady/' // eslint-disable-line max-len | ||
} | ||
@@ -987,6 +988,6 @@ }, | ||
name: 'Tears Of Steel (external text)', | ||
manifestUri: '//ams-samplescdn.streaming.mediaservices.windows.net/11196e3d-2f40-4835-9a4d-fc52751b0323/TearsOfSteel_WAMEH264SmoothStreaming720p.ism/manifest(format=mpd-time-csf)', // gjslint: disable=110 | ||
manifestUri: '//ams-samplescdn.streaming.mediaservices.windows.net/11196e3d-2f40-4835-9a4d-fc52751b0323/TearsOfSteel_WAMEH264SmoothStreaming720p.ism/manifest(format=mpd-time-csf)', // eslint-disable-line max-len | ||
extraText: [ | ||
{ | ||
uri: '//ams-samplescdn.streaming.mediaservices.windows.net/11196e3d-2f40-4835-9a4d-fc52751b0323/TOS-en.vtt', // gjslint: disable=110 | ||
uri: '//ams-samplescdn.streaming.mediaservices.windows.net/11196e3d-2f40-4835-9a4d-fc52751b0323/TOS-en.vtt', // eslint-disable-line max-len | ||
language: 'en', | ||
@@ -997,3 +998,3 @@ kind: 'subtitle', | ||
{ | ||
uri: '//ams-samplescdn.streaming.mediaservices.windows.net/11196e3d-2f40-4835-9a4d-fc52751b0323/TOS-es.vtt', // gjslint: disable=110 | ||
uri: '//ams-samplescdn.streaming.mediaservices.windows.net/11196e3d-2f40-4835-9a4d-fc52751b0323/TOS-es.vtt', // eslint-disable-line max-len | ||
language: 'es', | ||
@@ -1004,3 +1005,3 @@ kind: 'subtitle', | ||
{ | ||
uri: '//ams-samplescdn.streaming.mediaservices.windows.net/11196e3d-2f40-4835-9a4d-fc52751b0323/TOS-fr.vtt', // gjslint: disable=110 | ||
uri: '//ams-samplescdn.streaming.mediaservices.windows.net/11196e3d-2f40-4835-9a4d-fc52751b0323/TOS-fr.vtt', // eslint-disable-line max-len | ||
language: 'fr', | ||
@@ -1030,3 +1031,3 @@ kind: 'subtitle', | ||
name: 'live profile', | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-live/mp4-live-mpd-AV-BS.mpd', // gjslint: disable=110 | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-live/mp4-live-mpd-AV-BS.mpd', // eslint-disable-line max-len | ||
// NOTE: Multiple SPS/PPS in init segment, no sample duration | ||
@@ -1048,3 +1049,3 @@ // NOTE: Decoder errors on Mac | ||
name: 'live profile with five periods', | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-live-periods/mp4-live-periods-mpd.mpd', // gjslint: disable=110 | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-live-periods/mp4-live-periods-mpd.mpd', // eslint-disable-line max-len | ||
@@ -1062,3 +1063,3 @@ encoder: shakaAssets.Encoder.MP4BOX, | ||
name: 'main profile, single file', | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-main-single/mp4-main-single-mpd-AV-NBS.mpd', // gjslint: disable=110 | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-main-single/mp4-main-single-mpd-AV-NBS.mpd', // eslint-disable-line max-len | ||
@@ -1075,3 +1076,3 @@ encoder: shakaAssets.Encoder.MP4BOX, | ||
name: 'main profile, mutiple files', | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-main-multi/mp4-main-multi-mpd-AV-BS.mpd', // gjslint: disable=110 | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-main-multi/mp4-main-multi-mpd-AV-BS.mpd', // eslint-disable-line max-len | ||
// NOTE: Multiple SPS/PPS in init segment, no sample duration | ||
@@ -1093,3 +1094,3 @@ // NOTE: Decoder errors on Mac | ||
name: 'onDemand profile', | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-onDemand/mp4-onDemand-mpd-AV.mpd', // gjslint: disable=110 | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-onDemand/mp4-onDemand-mpd-AV.mpd', // eslint-disable-line max-len | ||
@@ -1106,3 +1107,3 @@ encoder: shakaAssets.Encoder.MP4BOX, | ||
name: 'main profile, open GOP', | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-main-ogop/mp4-main-ogop-mpd-AV-BS.mpd', // gjslint: disable=110 | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-main-ogop/mp4-main-ogop-mpd-AV-BS.mpd', // eslint-disable-line max-len | ||
// NOTE: Segments do not start with keyframes | ||
@@ -1123,3 +1124,3 @@ // NOTE: Decoder errors on Safari | ||
name: 'full profile, gradual decoding refresh', | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-full-gdr/mp4-full-gdr-mpd-AV-BS.mpd', // gjslint: disable=110 | ||
manifestUri: '//download.tsi.telecom-paristech.fr/gpac/DASH_CONFORMANCE/TelecomParisTech/mp4-full-gdr/mp4-full-gdr-mpd-AV-BS.mpd', // eslint-disable-line max-len | ||
// NOTE: segments do not start with keyframes | ||
@@ -1145,3 +1146,3 @@ // NOTE: Decoder errors on Safari | ||
// The playenabler and sl url parameters allow for playback in VMs | ||
manifestUri: 'https://content.uplynk.com/847859273a4b4a81959d8fea181672a4.mpd?pr.version=2&pr.playenabler=B621D91F-EDCC-4035-8D4B-DC71760D43E9&pr.securitylevel=150', // gjslint: disable=110 | ||
manifestUri: 'https://content.uplynk.com/847859273a4b4a81959d8fea181672a4.mpd?pr.version=2&pr.playenabler=B621D91F-EDCC-4035-8D4B-DC71760D43E9&pr.securitylevel=150', // eslint-disable-line max-len | ||
encoder: shakaAssets.Encoder.UPLYNK, | ||
@@ -1172,3 +1173,3 @@ source: shakaAssets.Source.UPLYNK, | ||
// The playenabler and sl url parameters allow for playback in VMs | ||
manifestUri: 'https://content.uplynk.com/054225d59be2454fabdca3e96912d847.mpd?ad=cleardash&pr.version=2&pr.playenabler=B621D91F-EDCC-4035-8D4B-DC71760D43E9&pr.securitylevel=150', // gjslint: disable=110 | ||
manifestUri: 'https://content.uplynk.com/054225d59be2454fabdca3e96912d847.mpd?ad=cleardash&pr.version=2&pr.playenabler=B621D91F-EDCC-4035-8D4B-DC71760D43E9&pr.securitylevel=150', // eslint-disable-line max-len | ||
encoder: shakaAssets.Encoder.UPLYNK, | ||
@@ -1198,3 +1199,3 @@ source: shakaAssets.Source.UPLYNK, | ||
name: 'Widevine - 16 Byte IV', | ||
manifestUri: 'https://content.uplynk.com/224ac8717e714b68831997ab6cea4015.mpd', // gjslint: disable=110 | ||
manifestUri: 'https://content.uplynk.com/224ac8717e714b68831997ab6cea4015.mpd', // eslint-disable-line max-len | ||
encoder: shakaAssets.Encoder.UPLYNK, | ||
@@ -1223,3 +1224,3 @@ source: shakaAssets.Source.UPLYNK, | ||
// Doesn't work on Chrome < 58 | ||
manifestUri: 'https://content.uplynk.com/1eb40d8e64234f5c9879db7045c3d48c.mpd?ad=cleardash&rays=cdefg', // gjslint: disable=110 | ||
manifestUri: 'https://content.uplynk.com/1eb40d8e64234f5c9879db7045c3d48c.mpd?ad=cleardash&rays=cdefg', // eslint-disable-line max-len | ||
@@ -1226,0 +1227,0 @@ encoder: shakaAssets.Encoder.UPLYNK, |
@@ -348,3 +348,3 @@ /** | ||
document.getElementById('bufferedDebug').textContent = | ||
'- ' + behind.toFixed(0) + 's / ' + '+ ' + ahead.toFixed(0) + 's'; | ||
'- ' + behind.toFixed(0) + 's / + ' + ahead.toFixed(0) + 's'; | ||
}; |
@@ -30,4 +30,4 @@ /** | ||
(function() { // anonymous namespace | ||
// The URL of the page itself, without URL fragments. | ||
var pageUrl = location.href.split('#')[0]; | ||
// The URL of the page itself, without URL fragments or search strings. | ||
var pageUrl = location.href.split('#')[0].split('?')[0]; | ||
// The URL of the page, up to and including the final '/'. | ||
@@ -58,3 +58,21 @@ var baseUrl = pageUrl.split('/').slice(0, -1).join('/') + '/'; | ||
// Check if ES6 is usable by evaluating arrow function syntax. | ||
var es6Available = true; | ||
try { | ||
eval('()=>{}'); | ||
} catch (e) { | ||
es6Available = false; | ||
} | ||
var scripts = window['UNCOMPILED_JS']; | ||
var buildType = 'uncompiled'; | ||
var buildSpecified = false; | ||
if (!es6Available) { | ||
// If ES6 arrow syntax is not supported (IE11), default to the compiled | ||
// debug version, which should still work. | ||
scripts = window['COMPILED_DEBUG_JS']; | ||
buildType = 'debug_compiled'; | ||
} | ||
if (!navigator.onLine) { | ||
@@ -64,8 +82,11 @@ // If we're offline, default to the compiled version, which may have been | ||
scripts = window['COMPILED_JS']; | ||
buildType = 'compiled'; | ||
} | ||
// Very old browsers do not have Array.prototype.indexOf. | ||
// Very old browsers do not have Array.prototype.indexOf, so we loop. | ||
for (var i = 0; i < combined.length; ++i) { | ||
if (combined[i] == 'compiled' || combined[i] == 'build=compiled') { | ||
scripts = window['COMPILED_JS']; | ||
buildType = 'compiled'; | ||
buildSpecified = true; | ||
break; | ||
@@ -75,2 +96,4 @@ } | ||
scripts = window['COMPILED_DEBUG_JS']; | ||
buildType = 'debug_compiled'; | ||
buildSpecified = true; | ||
break; | ||
@@ -80,2 +103,11 @@ } | ||
// If no build was specified in the URL, update the fragment with the default | ||
// we chose. | ||
if (!buildSpecified) { | ||
if (location.hash.length) { | ||
location.hash += ';'; | ||
} | ||
location.hash += 'build=' + buildType; | ||
} | ||
// The application must define its list of compiled and uncompiled sources | ||
@@ -82,0 +114,0 @@ // before including this loader. The URLs should be relative to the page. |
@@ -567,6 +567,6 @@ /** | ||
elem.classList.add('disabled_link'); | ||
elem.tabIndex = -1; | ||
elem.removeAttribute('href'); | ||
elem.title = 'currently selected'; | ||
} else { | ||
elem.classList.remove('disabled_link'); | ||
elem.tabIndex = 0; | ||
elem.onclick = function() { | ||
@@ -580,2 +580,13 @@ location.hash = strippedHash + ';build=' + type; | ||
// Check if ES6 is usable by evaluating arrow function syntax. | ||
try { | ||
eval('()=>{}'); | ||
} catch (e) { | ||
// If ES6 is not usable, neither is the uncompiled version of the app. | ||
var uncompiledLink = document.getElementById('uncompiled_link'); | ||
uncompiledLink.classList.add('disabled_link'); | ||
uncompiledLink.removeAttribute('href'); | ||
uncompiledLink.title = 'requires ES6'; | ||
} | ||
var newHash = '#' + params.join(';'); | ||
@@ -582,0 +593,0 @@ if (newHash != location.hash) { |
@@ -157,2 +157,3 @@ /** | ||
} | ||
return false; | ||
}).map(function(cacheName) { | ||
@@ -159,0 +160,0 @@ return caches.delete(cacheName); |
@@ -11,4 +11,4 @@ // This file was autogenerated by third_party/closure/deps/depswriter.py. | ||
goog.addDependency('../../../lib/dash/content_protection.js', ['shaka.dash.ContentProtection'], ['goog.asserts', 'shaka.log', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.ManifestParserUtils', 'shaka.util.MapUtils', 'shaka.util.Uint8ArrayUtils', 'shaka.util.XmlUtils']); | ||
goog.addDependency('../../../lib/dash/dash_parser.js', ['shaka.dash.DashParser'], ['goog.asserts', 'shaka.dash.ContentProtection', 'shaka.dash.SegmentBase', 'shaka.dash.SegmentList', 'shaka.dash.SegmentTemplate', 'shaka.log', 'shaka.media.DrmEngine', 'shaka.media.ManifestParser', 'shaka.media.PresentationTimeline', 'shaka.media.SegmentReference', 'shaka.net.NetworkingEngine', 'shaka.text.TextEngine', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.StringUtils', 'shaka.util.XmlUtils']); | ||
goog.addDependency('../../../lib/dash/mpd_utils.js', ['shaka.dash.MpdUtils'], ['goog.asserts', 'shaka.log', 'shaka.net.NetworkingEngine', 'shaka.util.Functional', 'shaka.util.ManifestParserUtils', 'shaka.util.StringUtils', 'shaka.util.XmlUtils']); | ||
goog.addDependency('../../../lib/dash/dash_parser.js', ['shaka.dash.DashParser'], ['goog.asserts', 'shaka.dash.ContentProtection', 'shaka.dash.MpdUtils', 'shaka.dash.SegmentBase', 'shaka.dash.SegmentList', 'shaka.dash.SegmentTemplate', 'shaka.log', 'shaka.media.DrmEngine', 'shaka.media.ManifestParser', 'shaka.media.PresentationTimeline', 'shaka.media.SegmentReference', 'shaka.net.NetworkingEngine', 'shaka.text.TextEngine', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.StringUtils', 'shaka.util.XmlUtils']); | ||
goog.addDependency('../../../lib/dash/mpd_utils.js', ['shaka.dash.MpdUtils'], ['goog.asserts', 'shaka.log', 'shaka.net.NetworkingEngine', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.ManifestParserUtils', 'shaka.util.StringUtils', 'shaka.util.XmlUtils']); | ||
goog.addDependency('../../../lib/dash/segment_base.js', ['shaka.dash.SegmentBase'], ['goog.asserts', 'shaka.dash.MpdUtils', 'shaka.log', 'shaka.media.InitSegmentReference', 'shaka.media.Mp4SegmentIndexParser', 'shaka.media.SegmentIndex', 'shaka.media.WebmSegmentIndexParser', 'shaka.util.Error', 'shaka.util.ManifestParserUtils', 'shaka.util.XmlUtils']); | ||
@@ -20,3 +20,3 @@ goog.addDependency('../../../lib/dash/segment_list.js', ['shaka.dash.SegmentList'], ['goog.asserts', 'shaka.dash.MpdUtils', 'shaka.dash.SegmentBase', 'shaka.log', 'shaka.media.SegmentIndex', 'shaka.media.SegmentReference', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.ManifestParserUtils', 'shaka.util.XmlUtils']); | ||
goog.addDependency('../../../lib/hls/hls_classes.js', ['shaka.hls.Attribute', 'shaka.hls.Playlist', 'shaka.hls.PlaylistType', 'shaka.hls.Segment', 'shaka.hls.Tag'], ['goog.asserts']); | ||
goog.addDependency('../../../lib/hls/hls_parser.js', ['shaka.hls.HlsParser'], ['goog.Uri', 'goog.asserts', 'shaka.hls.ManifestTextParser', 'shaka.hls.Playlist', 'shaka.hls.PlaylistType', 'shaka.hls.Tag', 'shaka.hls.Utils', 'shaka.log', 'shaka.media.DrmEngine', 'shaka.media.InitSegmentReference', 'shaka.media.ManifestParser', 'shaka.media.PresentationTimeline', 'shaka.media.SegmentIndex', 'shaka.media.SegmentReference', 'shaka.net.DataUriPlugin', 'shaka.net.NetworkingEngine', 'shaka.text.TextEngine', 'shaka.util.DataViewReader', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils']); | ||
goog.addDependency('../../../lib/hls/hls_parser.js', ['shaka.hls.HlsParser'], ['goog.Uri', 'goog.asserts', 'shaka.hls.ManifestTextParser', 'shaka.hls.Playlist', 'shaka.hls.PlaylistType', 'shaka.hls.Tag', 'shaka.hls.Utils', 'shaka.log', 'shaka.media.DrmEngine', 'shaka.media.InitSegmentReference', 'shaka.media.ManifestParser', 'shaka.media.PresentationTimeline', 'shaka.media.SegmentIndex', 'shaka.media.SegmentReference', 'shaka.net.DataUriPlugin', 'shaka.net.NetworkingEngine', 'shaka.text.TextEngine', 'shaka.util.DataViewReader', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.MimeUtils', 'shaka.util.Mp4Parser']); | ||
goog.addDependency('../../../lib/hls/hls_utils.js', ['shaka.hls.Utils'], ['shaka.util.ManifestParserUtils']); | ||
@@ -44,4 +44,4 @@ goog.addDependency('../../../lib/hls/manifest_text_parser.js', ['shaka.hls.ManifestTextParser'], ['shaka.hls.Attribute', 'shaka.hls.Playlist', 'shaka.hls.PlaylistType', 'shaka.hls.Segment', 'shaka.hls.Tag', 'shaka.hls.Utils', 'shaka.util.Error', 'shaka.util.StringUtils', 'shaka.util.TextParser']); | ||
goog.addDependency('../../../lib/offline/db_upgrade_from_version_0.js', ['shaka.offline.DBUpgradeFromVersion0'], ['goog.asserts', 'shaka.offline.DBUpgrade', 'shaka.offline.DBUtils']); | ||
goog.addDependency('../../../lib/offline/db_upgrade_from_version_1.js', ['shaka.offline.DBUpgradeFromVersion1'], ['goog.asserts', 'shaka.log', 'shaka.offline.DBUpgrade']); | ||
goog.addDependency('../../../lib/offline/db_utils.js', ['shaka.offline.DBUtils'], ['shaka.util.Error', 'shaka.util.PublicPromise']); | ||
goog.addDependency('../../../lib/offline/db_upgrade_from_version_1.js', ['shaka.offline.DBUpgradeFromVersion1'], ['goog.asserts', 'shaka.log', 'shaka.offline.DBUpgrade', 'shaka.offline.DBUtils', 'shaka.util.ManifestParserUtils']); | ||
goog.addDependency('../../../lib/offline/db_utils.js', ['shaka.offline.DBUtils'], ['shaka.log', 'shaka.util.Error', 'shaka.util.PublicPromise']); | ||
goog.addDependency('../../../lib/offline/download_manager.js', ['shaka.offline.DownloadManager'], ['goog.asserts', 'shaka.net.NetworkingEngine', 'shaka.util.Error', 'shaka.util.IDestroyable', 'shaka.util.MapUtils']); | ||
@@ -52,3 +52,3 @@ goog.addDependency('../../../lib/offline/i_storage_engine.js', ['shaka.offline.IStorageEngine'], ['shaka.util.IDestroyable']); | ||
goog.addDependency('../../../lib/offline/offline_uri.js', ['shaka.offline.OfflineUri'], []); | ||
goog.addDependency('../../../lib/offline/offline_utils.js', ['shaka.offline.OfflineUtils'], ['goog.asserts', 'shaka.media.InitSegmentReference', 'shaka.media.PresentationTimeline', 'shaka.media.SegmentIndex', 'shaka.media.SegmentReference', 'shaka.util.ManifestParserUtils', 'shaka.util.StreamUtils']); | ||
goog.addDependency('../../../lib/offline/offline_utils.js', ['shaka.offline.OfflineUtils'], ['goog.asserts', 'shaka.media.InitSegmentReference', 'shaka.media.PresentationTimeline', 'shaka.media.SegmentIndex', 'shaka.media.SegmentReference', 'shaka.offline.OfflineUri', 'shaka.util.ManifestParserUtils', 'shaka.util.MapUtils', 'shaka.util.StreamUtils']); | ||
goog.addDependency('../../../lib/offline/storage.js', ['shaka.offline.Storage'], ['goog.asserts', 'shaka.Player', 'shaka.log', 'shaka.media.DrmEngine', 'shaka.media.ManifestParser', 'shaka.offline.DownloadManager', 'shaka.offline.IStorageEngine', 'shaka.offline.OfflineManifestParser', 'shaka.offline.OfflineUri', 'shaka.offline.OfflineUtils', 'shaka.offline.StorageEngineFactory', 'shaka.util.ConfigUtils', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.IDestroyable', 'shaka.util.LanguageUtils', 'shaka.util.ManifestParserUtils', 'shaka.util.StreamUtils']); | ||
@@ -74,3 +74,3 @@ goog.addDependency('../../../lib/offline/storage_engine_factory.js', ['shaka.offline.StorageEngineFactory'], ['shaka.offline.DBEngine', 'shaka.offline.IStorageEngine', 'shaka.util.Error']); | ||
goog.addDependency('../../../lib/text/mp4_vtt_parser.js', ['shaka.text.Mp4VttParser'], ['goog.asserts', 'shaka.log', 'shaka.text.Cue', 'shaka.text.TextEngine', 'shaka.text.VttTextParser', 'shaka.util.DataViewReader', 'shaka.util.Error', 'shaka.util.Functional', 'shaka.util.Mp4Parser', 'shaka.util.StringUtils', 'shaka.util.TextParser']); | ||
goog.addDependency('../../../lib/text/simple_text_displayer.js', ['shaka.text.SimpleTextDisplayer'], ['goog.asserts', 'shaka.log']); | ||
goog.addDependency('../../../lib/text/simple_text_displayer.js', ['shaka.text.SimpleTextDisplayer'], ['goog.asserts', 'shaka.log', 'shaka.text.Cue']); | ||
goog.addDependency('../../../lib/text/text_engine.js', ['shaka.text.TextEngine'], ['goog.asserts', 'shaka.util.Error', 'shaka.util.IDestroyable']); | ||
@@ -77,0 +77,0 @@ goog.addDependency('../../../lib/text/ttml_text_parser.js', ['shaka.text.TtmlTextParser'], ['goog.asserts', 'shaka.text.Cue', 'shaka.text.TextEngine', 'shaka.util.ArrayUtils', 'shaka.util.Error', 'shaka.util.StringUtils']); |
@@ -97,3 +97,3 @@ /* | ||
ShakaControls.prototype.isOpaque_=function(){if(!this.enabled_)return!1;if(this.castProxy_&&this.castProxy_.isCasting())return!0;var a=this.controls_.parentElement;return 1==this.controls_.style.opacity||a.querySelector("#controls:hover")==this.controls_}; | ||
ShakaControls.prototype.updateTimeAndSeekRange_=function(){if(this.isOpaque_()){var a=this.isSeeking_?this.seekBar_.value:this.video_.currentTime;var b=this.video_.duration;var c=this.video_.buffered.length,f=c?this.video_.buffered.start(0):0,d=c?this.video_.buffered.end(c-1):0,e=this.player_.seekRange(),g=e.end-e.start;this.seekBar_.min=e.start;this.seekBar_.max=e.end;this.player_.isLive()?(a=Math.max(0,Math.floor(e.end-a)),b=3600<=g,1<=a||this.isSeeking_?(this.currentTime_.textContent="- "+this.buildTimeString_(a, | ||
ShakaControls.prototype.updateTimeAndSeekRange_=function(){if(this.isOpaque_()){var a=this.isSeeking_?this.seekBar_.value:this.video_.currentTime,b=this.video_.duration,c=this.video_.buffered.length,f=c?this.video_.buffered.start(0):0,d=c?this.video_.buffered.end(c-1):0,e=this.player_.seekRange(),g=e.end-e.start;this.seekBar_.min=e.start;this.seekBar_.max=e.end;this.player_.isLive()?(a=Math.max(0,Math.floor(e.end-a)),b=3600<=g,1<=a||this.isSeeking_?(this.currentTime_.textContent="- "+this.buildTimeString_(a, | ||
b),this.currentTime_.style.cursor="pointer"):(this.currentTime_.textContent="LIVE",this.currentTime_.style.cursor=""),this.isSeeking_||(this.seekBar_.value=e.end-a)):(this.currentTime_.textContent=this.buildTimeString_(a,3600<=b),this.isSeeking_||(this.seekBar_.value=a),this.currentTime_.style.cursor="");b=["to right"];0==c?b.push("#000 0%"):(c=(Math.max(f,e.start)-e.start)/g||0,d=(Math.min(d,e.end)-e.start)/g||0,a=(a-e.start)/g||0,b.push("#000 "+100*c+"%"),b.push("#ccc "+100*c+"%"),b.push("#ccc "+ | ||
@@ -100,0 +100,0 @@ 100*a+"%"),b.push("#444 "+100*a+"%"),b.push("#444 "+100*d+"%"),b.push("#000 "+100*d+"%"));this.seekBar_.style.background="linear-gradient("+b.join(",")+")"}};ShakaControls.prototype.buildTimeString_=function(a,b){var c=Math.floor(a/3600),f=Math.floor(a/60%60),d=Math.floor(a%60);10>d&&(d="0"+d);d=f+":"+d;b&&(10>f&&(d="0"+d),d=c+":"+d);return d};var ShakaDemoUtils={setupAssetMetadata:function(a,b){var c={drm:{},manifest:{dash:{}}};a.licenseServers&&(c.drm.servers=a.licenseServers);a.drmCallback&&(c.manifest.dash.customScheme=a.drmCallback);a.clearKeys&&(c.drm.clearKeys=a.clearKeys);b.configure(c);c=b.getNetworkingEngine();c.clearAllRequestFilters();c.clearAllResponseFilters();if(a.licenseRequestHeaders){var f=ShakaDemoUtils.addLicenseRequestHeaders_.bind(null,a.licenseRequestHeaders);c.registerRequestFilter(f)}a.requestFilter&&c.registerRequestFilter(a.requestFilter); |
@@ -97,3 +97,3 @@ /* | ||
ShakaControls.prototype.isOpaque_=function(){if(!this.enabled_)return!1;if(this.castProxy_&&this.castProxy_.isCasting())return!0;var a=this.controls_.parentElement;return 1==this.controls_.style.opacity||a.querySelector("#controls:hover")==this.controls_}; | ||
ShakaControls.prototype.updateTimeAndSeekRange_=function(){if(this.isOpaque_()){var a=this.isSeeking_?this.seekBar_.value:this.video_.currentTime;var b=this.video_.duration;var c=this.video_.buffered.length,f=c?this.video_.buffered.start(0):0,d=c?this.video_.buffered.end(c-1):0,e=this.player_.seekRange(),g=e.end-e.start;this.seekBar_.min=e.start;this.seekBar_.max=e.end;this.player_.isLive()?(a=Math.max(0,Math.floor(e.end-a)),b=3600<=g,1<=a||this.isSeeking_?(this.currentTime_.textContent="- "+this.buildTimeString_(a, | ||
ShakaControls.prototype.updateTimeAndSeekRange_=function(){if(this.isOpaque_()){var a=this.isSeeking_?this.seekBar_.value:this.video_.currentTime,b=this.video_.duration,c=this.video_.buffered.length,f=c?this.video_.buffered.start(0):0,d=c?this.video_.buffered.end(c-1):0,e=this.player_.seekRange(),g=e.end-e.start;this.seekBar_.min=e.start;this.seekBar_.max=e.end;this.player_.isLive()?(a=Math.max(0,Math.floor(e.end-a)),b=3600<=g,1<=a||this.isSeeking_?(this.currentTime_.textContent="- "+this.buildTimeString_(a, | ||
b),this.currentTime_.style.cursor="pointer"):(this.currentTime_.textContent="LIVE",this.currentTime_.style.cursor=""),this.isSeeking_||(this.seekBar_.value=e.end-a)):(this.currentTime_.textContent=this.buildTimeString_(a,3600<=b),this.isSeeking_||(this.seekBar_.value=a),this.currentTime_.style.cursor="");b=["to right"];0==c?b.push("#000 0%"):(c=(Math.max(f,e.start)-e.start)/g||0,d=(Math.min(d,e.end)-e.start)/g||0,a=(a-e.start)/g||0,b.push("#000 "+100*c+"%"),b.push("#ccc "+100*c+"%"),b.push("#ccc "+ | ||
@@ -100,0 +100,0 @@ 100*a+"%"),b.push("#444 "+100*a+"%"),b.push("#444 "+100*d+"%"),b.push("#000 "+100*d+"%"));this.seekBar_.style.background="linear-gradient("+b.join(",")+")"}};ShakaControls.prototype.buildTimeString_=function(a,b){var c=Math.floor(a/3600),f=Math.floor(a/60%60),d=Math.floor(a%60);10>d&&(d="0"+d);d=f+":"+d;b&&(10>f&&(d="0"+d),d=c+":"+d);return d};var ShakaDemoUtils={setupAssetMetadata:function(a,b){var c={drm:{},manifest:{dash:{}}};a.licenseServers&&(c.drm.servers=a.licenseServers);a.drmCallback&&(c.manifest.dash.customScheme=a.drmCallback);a.clearKeys&&(c.drm.clearKeys=a.clearKeys);b.configure(c);c=b.getNetworkingEngine();c.clearAllRequestFilters();c.clearAllResponseFilters();if(a.licenseRequestHeaders){var f=ShakaDemoUtils.addLicenseRequestHeaders_.bind(null,a.licenseRequestHeaders);c.registerRequestFilter(f)}a.requestFilter&&c.registerRequestFilter(a.requestFilter); |
@@ -853,2 +853,134 @@ /** | ||
/** | ||
* Creates a Cue object. | ||
* @param {number} startTime | ||
* @param {number} endTime | ||
* @param {!string} payload | ||
* @implements {shakaExtern.Cue} | ||
* @constructor | ||
* @struct | ||
*/ | ||
shaka.text.Cue = function(startTime, endTime, payload) {}; | ||
/** @override */ | ||
shaka.text.Cue.prototype.startTime; | ||
/** @override */ | ||
shaka.text.Cue.prototype.endTime; | ||
/** @override */ | ||
shaka.text.Cue.prototype.payload; | ||
/** @override */ | ||
shaka.text.Cue.prototype.region; | ||
/** @override */ | ||
shaka.text.Cue.prototype.position; | ||
/** @override */ | ||
shaka.text.Cue.prototype.positionAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.size; | ||
/** @override */ | ||
shaka.text.Cue.prototype.textAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.writingDirection; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineInterpretation; | ||
/** @override */ | ||
shaka.text.Cue.prototype.line; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineHeight; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.displayAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.color; | ||
/** @override */ | ||
shaka.text.Cue.prototype.backgroundColor; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontSize; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontWeight; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontStyle; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontFamily; | ||
/** @override */ | ||
shaka.text.Cue.prototype.textDecoration; | ||
/** @override */ | ||
shaka.text.Cue.prototype.wrapLine; | ||
/** @override */ | ||
shaka.text.Cue.prototype.id; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.positionAlign = { | ||
'LEFT': 'line-left', | ||
'RIGHT': 'line-right', | ||
'CENTER': 'center', | ||
'AUTO': 'auto' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.textAlign = { | ||
'LEFT': 'left', | ||
'RIGHT': 'right', | ||
'CENTER': 'center', | ||
'START': 'start', | ||
'END': 'end' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.displayAlign = { | ||
'BEFORE': 'before', | ||
'CENTER': 'center', | ||
'AFTER': 'after' | ||
}; | ||
/** | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.writingDirection = { | ||
'HORIZONTAL_LEFT_TO_RIGHT': 0, | ||
'HORIZONTAL_RIGHT_TO_LEFT': 1, | ||
'VERTICAL_LEFT_TO_RIGHT': 2, | ||
'VERTICAL_RIGHT_TO_LEFT': 3 | ||
}; | ||
/** | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.lineInterpretation = { | ||
'LINE_NUMBER': 0, | ||
'PERCENTAGE': 1 | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.lineAlign = { | ||
'CENTER': 'center', | ||
'START': 'start', | ||
'END': 'end' | ||
}; | ||
/** | ||
* In CSS font weight can be a number, where 400 is normal | ||
* and 700 is bold. Use these values for the enum for consistency. | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.fontWeight = { | ||
'NORMAL': 400, | ||
'BOLD': 700 | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.fontStyle = { | ||
'NORMAL': 'normal', | ||
'ITALIC': 'italic', | ||
'OBLIQUE': 'oblique' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.textDecoration = { | ||
'UNDERLINE': 'underline', | ||
'LINE_THROUGH': 'lineThrough', | ||
'OVERLINE': 'overline' | ||
}; | ||
/** | ||
* <p> | ||
@@ -1392,134 +1524,2 @@ * This defines the default text displayer plugin. An instance of this | ||
/** | ||
* Creates a Cue object. | ||
* @param {number} startTime | ||
* @param {number} endTime | ||
* @param {!string} payload | ||
* @implements {shakaExtern.Cue} | ||
* @constructor | ||
* @struct | ||
*/ | ||
shaka.text.Cue = function(startTime, endTime, payload) {}; | ||
/** @override */ | ||
shaka.text.Cue.prototype.startTime; | ||
/** @override */ | ||
shaka.text.Cue.prototype.endTime; | ||
/** @override */ | ||
shaka.text.Cue.prototype.payload; | ||
/** @override */ | ||
shaka.text.Cue.prototype.region; | ||
/** @override */ | ||
shaka.text.Cue.prototype.position; | ||
/** @override */ | ||
shaka.text.Cue.prototype.positionAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.size; | ||
/** @override */ | ||
shaka.text.Cue.prototype.textAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.writingDirection; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineInterpretation; | ||
/** @override */ | ||
shaka.text.Cue.prototype.line; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineHeight; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.displayAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.color; | ||
/** @override */ | ||
shaka.text.Cue.prototype.backgroundColor; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontSize; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontWeight; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontStyle; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontFamily; | ||
/** @override */ | ||
shaka.text.Cue.prototype.textDecoration; | ||
/** @override */ | ||
shaka.text.Cue.prototype.wrapLine; | ||
/** @override */ | ||
shaka.text.Cue.prototype.id; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.positionAlign = { | ||
'LEFT': 'line-left', | ||
'RIGHT': 'line-right', | ||
'CENTER': 'center', | ||
'AUTO': 'auto' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.textAlign = { | ||
'LEFT': 'left', | ||
'RIGHT': 'right', | ||
'CENTER': 'center', | ||
'START': 'start', | ||
'END': 'end' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.displayAlign = { | ||
'BEFORE': 'before', | ||
'CENTER': 'center', | ||
'AFTER': 'after' | ||
}; | ||
/** | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.writingDirection = { | ||
'HORIZONTAL_LEFT_TO_RIGHT': 0, | ||
'HORIZONTAL_RIGHT_TO_LEFT': 1, | ||
'VERTICAL_LEFT_TO_RIGHT': 2, | ||
'VERTICAL_RIGHT_TO_LEFT': 3 | ||
}; | ||
/** | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.lineInterpretation = { | ||
'LINE_NUMBER': 0, | ||
'PERCENTAGE': 1 | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.lineAlign = { | ||
'CENTER': 'center', | ||
'START': 'start', | ||
'END': 'end' | ||
}; | ||
/** | ||
* In CSS font weight can be a number, where 400 is normal | ||
* and 700 is bold. Use these values for the enum for consistency. | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.fontWeight = { | ||
'NORMAL': 400, | ||
'BOLD': 700 | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.fontStyle = { | ||
'NORMAL': 'normal', | ||
'ITALIC': 'italic', | ||
'OBLIQUE': 'oblique' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.textDecoration = { | ||
'UNDERLINE': 'underline', | ||
'LINE_THROUGH': 'lineThrough', | ||
'OVERLINE': 'overline' | ||
}; | ||
/** | ||
* A proxy to switch between local and remote playback for Chromecast in a way | ||
@@ -1526,0 +1526,0 @@ * that is transparent to the app's controls. |
@@ -853,2 +853,134 @@ /** | ||
/** | ||
* Creates a Cue object. | ||
* @param {number} startTime | ||
* @param {number} endTime | ||
* @param {!string} payload | ||
* @implements {shakaExtern.Cue} | ||
* @constructor | ||
* @struct | ||
*/ | ||
shaka.text.Cue = function(startTime, endTime, payload) {}; | ||
/** @override */ | ||
shaka.text.Cue.prototype.startTime; | ||
/** @override */ | ||
shaka.text.Cue.prototype.endTime; | ||
/** @override */ | ||
shaka.text.Cue.prototype.payload; | ||
/** @override */ | ||
shaka.text.Cue.prototype.region; | ||
/** @override */ | ||
shaka.text.Cue.prototype.position; | ||
/** @override */ | ||
shaka.text.Cue.prototype.positionAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.size; | ||
/** @override */ | ||
shaka.text.Cue.prototype.textAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.writingDirection; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineInterpretation; | ||
/** @override */ | ||
shaka.text.Cue.prototype.line; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineHeight; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.displayAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.color; | ||
/** @override */ | ||
shaka.text.Cue.prototype.backgroundColor; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontSize; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontWeight; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontStyle; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontFamily; | ||
/** @override */ | ||
shaka.text.Cue.prototype.textDecoration; | ||
/** @override */ | ||
shaka.text.Cue.prototype.wrapLine; | ||
/** @override */ | ||
shaka.text.Cue.prototype.id; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.positionAlign = { | ||
'LEFT': 'line-left', | ||
'RIGHT': 'line-right', | ||
'CENTER': 'center', | ||
'AUTO': 'auto' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.textAlign = { | ||
'LEFT': 'left', | ||
'RIGHT': 'right', | ||
'CENTER': 'center', | ||
'START': 'start', | ||
'END': 'end' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.displayAlign = { | ||
'BEFORE': 'before', | ||
'CENTER': 'center', | ||
'AFTER': 'after' | ||
}; | ||
/** | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.writingDirection = { | ||
'HORIZONTAL_LEFT_TO_RIGHT': 0, | ||
'HORIZONTAL_RIGHT_TO_LEFT': 1, | ||
'VERTICAL_LEFT_TO_RIGHT': 2, | ||
'VERTICAL_RIGHT_TO_LEFT': 3 | ||
}; | ||
/** | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.lineInterpretation = { | ||
'LINE_NUMBER': 0, | ||
'PERCENTAGE': 1 | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.lineAlign = { | ||
'CENTER': 'center', | ||
'START': 'start', | ||
'END': 'end' | ||
}; | ||
/** | ||
* In CSS font weight can be a number, where 400 is normal | ||
* and 700 is bold. Use these values for the enum for consistency. | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.fontWeight = { | ||
'NORMAL': 400, | ||
'BOLD': 700 | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.fontStyle = { | ||
'NORMAL': 'normal', | ||
'ITALIC': 'italic', | ||
'OBLIQUE': 'oblique' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.textDecoration = { | ||
'UNDERLINE': 'underline', | ||
'LINE_THROUGH': 'lineThrough', | ||
'OVERLINE': 'overline' | ||
}; | ||
/** | ||
* <p> | ||
@@ -1392,134 +1524,2 @@ * This defines the default text displayer plugin. An instance of this | ||
/** | ||
* Creates a Cue object. | ||
* @param {number} startTime | ||
* @param {number} endTime | ||
* @param {!string} payload | ||
* @implements {shakaExtern.Cue} | ||
* @constructor | ||
* @struct | ||
*/ | ||
shaka.text.Cue = function(startTime, endTime, payload) {}; | ||
/** @override */ | ||
shaka.text.Cue.prototype.startTime; | ||
/** @override */ | ||
shaka.text.Cue.prototype.endTime; | ||
/** @override */ | ||
shaka.text.Cue.prototype.payload; | ||
/** @override */ | ||
shaka.text.Cue.prototype.region; | ||
/** @override */ | ||
shaka.text.Cue.prototype.position; | ||
/** @override */ | ||
shaka.text.Cue.prototype.positionAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.size; | ||
/** @override */ | ||
shaka.text.Cue.prototype.textAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.writingDirection; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineInterpretation; | ||
/** @override */ | ||
shaka.text.Cue.prototype.line; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineHeight; | ||
/** @override */ | ||
shaka.text.Cue.prototype.lineAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.displayAlign; | ||
/** @override */ | ||
shaka.text.Cue.prototype.color; | ||
/** @override */ | ||
shaka.text.Cue.prototype.backgroundColor; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontSize; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontWeight; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontStyle; | ||
/** @override */ | ||
shaka.text.Cue.prototype.fontFamily; | ||
/** @override */ | ||
shaka.text.Cue.prototype.textDecoration; | ||
/** @override */ | ||
shaka.text.Cue.prototype.wrapLine; | ||
/** @override */ | ||
shaka.text.Cue.prototype.id; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.positionAlign = { | ||
'LEFT': 'line-left', | ||
'RIGHT': 'line-right', | ||
'CENTER': 'center', | ||
'AUTO': 'auto' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.textAlign = { | ||
'LEFT': 'left', | ||
'RIGHT': 'right', | ||
'CENTER': 'center', | ||
'START': 'start', | ||
'END': 'end' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.displayAlign = { | ||
'BEFORE': 'before', | ||
'CENTER': 'center', | ||
'AFTER': 'after' | ||
}; | ||
/** | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.writingDirection = { | ||
'HORIZONTAL_LEFT_TO_RIGHT': 0, | ||
'HORIZONTAL_RIGHT_TO_LEFT': 1, | ||
'VERTICAL_LEFT_TO_RIGHT': 2, | ||
'VERTICAL_RIGHT_TO_LEFT': 3 | ||
}; | ||
/** | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.lineInterpretation = { | ||
'LINE_NUMBER': 0, | ||
'PERCENTAGE': 1 | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.lineAlign = { | ||
'CENTER': 'center', | ||
'START': 'start', | ||
'END': 'end' | ||
}; | ||
/** | ||
* In CSS font weight can be a number, where 400 is normal | ||
* and 700 is bold. Use these values for the enum for consistency. | ||
* @enum {number} | ||
*/ | ||
shaka.text.Cue.fontWeight = { | ||
'NORMAL': 400, | ||
'BOLD': 700 | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.fontStyle = { | ||
'NORMAL': 'normal', | ||
'ITALIC': 'italic', | ||
'OBLIQUE': 'oblique' | ||
}; | ||
/** | ||
* @enum {string} | ||
*/ | ||
shaka.text.Cue.textDecoration = { | ||
'UNDERLINE': 'underline', | ||
'LINE_THROUGH': 'lineThrough', | ||
'OVERLINE': 'overline' | ||
}; | ||
/** | ||
* A proxy to switch between local and remote playback for Chromecast in a way | ||
@@ -1526,0 +1526,0 @@ * that is transparent to the app's controls. |
@@ -96,5 +96,6 @@ # Frequently Asked Questions | ||
You can enable transmuxing by [including mux.js][] in your application. If | ||
Shaka Player detects that mux.js has been loaded, we will use it to transmux TS | ||
content into MP4 on-the-fly, so that the content can be played by the browser. | ||
You can enable transmuxing by [including mux.js][] v4.4+ in your application. | ||
If Shaka Player detects that mux.js has been loaded, we will use it to transmux | ||
TS content into MP4 on-the-fly, so that the content can be played by the | ||
browser. | ||
@@ -123,3 +124,19 @@ <hr> | ||
<hr> | ||
**Q:** I am getting `UNSUPPORTED_SCHEME` or error code 1000 when loading from | ||
`file://`. | ||
**A:** In a browser environment, trying to load a file from `file://` is | ||
inappropriate. Therefore, we do not provide a default network plugin for such | ||
requests. | ||
In other environments, for example Electron, it is appropriate. | ||
In those cases, before Shaka Player loads a manifest, you can register the | ||
existing http plugin for `file://` requests: | ||
```js | ||
shaka.net.NetworkingEngine.registerScheme('file', shaka.net.HttpPlugin); | ||
``` | ||
[386]: https://github.com/google/shaka-player/issues/386#issuecomment-227898001 | ||
@@ -126,0 +143,0 @@ [489]: https://github.com/google/shaka-player/issues/489#issuecomment-240466224 |
@@ -20,4 +20,4 @@ [ | ||
"upgrade-v1": { "title": "Upgrade Guide, v1 => v2" }, | ||
"upgrade-v2-0": { "title": "Upgrade Guide, v2.0 => v2.2" }, | ||
"upgrade-v2-1": { "title": "Upgrade Guide, v2.1 => v2.2" }, | ||
"upgrade-v2-0": { "title": "Upgrade Guide, v2.0 => v2.3" }, | ||
"upgrade-v2-1": { "title": "Upgrade Guide, v2.1 => v2.3" }, | ||
"upgrade-v2-2": { "title": "Upgrade Guide, v2.2 => v2.3" } | ||
@@ -24,0 +24,0 @@ } |
@@ -66,3 +66,3 @@ # Offline Storage and Playback | ||
<span><progress id="progress-bar" value="0" max="100"></span> | ||
<span><button id="download-button">Download</button></span></span> | ||
<span><button id="download-button">Download</button></span> | ||
</div> | ||
@@ -419,3 +419,3 @@ | ||
<span><progress id="progress-bar" value="0" max="100"></span> | ||
<span><button id="download-button">Download</button></span></span> | ||
<span><button id="download-button">Download</button></span> | ||
</div> | ||
@@ -422,0 +422,0 @@ |
@@ -248,3 +248,3 @@ # Shaka Upgrade Guide, v1.x => v2 | ||
Shaka v1's license-request-releated settings have moved to v2's network filters. | ||
Shaka v1's license-request-related settings have moved to v2's network filters. | ||
@@ -251,0 +251,0 @@ Network filters are a generic filtering system for all networking, including |
@@ -8,1 +8,3 @@ # Shaka Player Upgrade Guide | ||
If you are upgrading from v2.1, please see {@tutorial upgrade-v2-1}. | ||
If you are upgrading from v2.2, please see {@tutorial upgrade-v2-2}. |
@@ -32,3 +32,3 @@ # Welcome to Shaka Player | ||
* Python 2.7.x {@link https://www.python.org/downloads/} | ||
* Java Runtime Environment 7+ {@link https://java.com/en/download/} | ||
* Java Runtime Environment 8+ {@link https://java.com/en/download/} | ||
* A local web server | ||
@@ -35,0 +35,0 @@ * _NOTE: A local web server is required because browsers place restrictions |
@@ -36,4 +36,5 @@ /** | ||
* @struct | ||
* @param {Object=} opt_options | ||
*/ | ||
muxjs.mp4.Transmuxer = function() {}; | ||
muxjs.mp4.Transmuxer = function(opt_options) {}; | ||
@@ -40,0 +41,0 @@ |
@@ -306,2 +306,3 @@ /** | ||
* Whether this key system supports persistent state. | ||
* @exportDoc | ||
*/ | ||
@@ -364,2 +365,3 @@ shakaExtern.DrmSupportType; | ||
* The XML element that defines the Event. | ||
* @exportDoc | ||
*/ | ||
@@ -366,0 +368,0 @@ shakaExtern.TimelineRegionInfo; |
@@ -243,5 +243,5 @@ /** | ||
* @typedef {{ | ||
* periodStart : number, | ||
* segmentStart : number, | ||
* segmentEnd : number | ||
* periodStart: number, | ||
* segmentStart: ?number, | ||
* segmentEnd: number | ||
* }} | ||
@@ -251,4 +251,5 @@ * | ||
* The absolute start time of the period in seconds. | ||
* @property {number} segmentStart | ||
* @property {?number} segmentStart | ||
* The absolute start time of the segment in seconds. | ||
* Null if the manifest does not provide this information, such as in HLS. | ||
* @property {number} segmentEnd | ||
@@ -255,0 +256,0 @@ * The absolute end time of the segment in seconds. |
@@ -30,7 +30,7 @@ /** | ||
/** @type {string} */ | ||
/** @type {string} */ | ||
TextTrackCue.prototype.positionAlign; | ||
/** @type {string} */ | ||
/** @type {string} */ | ||
TextTrackCue.prototype.lineAlign; | ||
@@ -37,0 +37,0 @@ |
@@ -68,2 +68,4 @@ /** | ||
'jasmine-ajax', 'jasmine', | ||
// Fixes backtraces after Babel preprocessing | ||
'source-map-support', | ||
], | ||
@@ -122,8 +124,25 @@ | ||
preprocessors: { | ||
// Don't compute coverage over lib/debug/ or lib/polyfill/ | ||
'lib/!(debug|polyfill)/*.js': 'coverage', | ||
// Compute coverage over everything but lib/debug/ or lib/polyfill/ | ||
'lib/!(debug|polyfill)/*.js': ['coverage'], | ||
// Player is not matched by the above, so add it explicitly | ||
'lib/player.js': 'coverage', | ||
'lib/player.js': ['coverage'], | ||
// Convert ES6 to ES5 so we can still run tests on IE11. | ||
'lib/**/*.js': ['babel'], | ||
'test/**/*.js': ['babel'], | ||
}, | ||
babelPreprocessor: { | ||
options: { | ||
presets: [ | ||
// Some of our tests are not written with strict mode in mind, but the | ||
// plugin for commonjs modules enforces strict mode. Since we do not | ||
// use modules, just disable them. | ||
['env', { modules: false }], | ||
], | ||
// The source-map-support framework is necessary to make this work: | ||
sourceMap: 'inline', | ||
}, | ||
}, | ||
// to avoid DISCONNECTED messages on Safari: | ||
@@ -130,0 +149,0 @@ browserDisconnectTimeout: 10 * 1000, // 10s to reconnect |
@@ -84,2 +84,5 @@ /** | ||
/** @private {boolean} */ | ||
this.initialStatusUpdatePending_ = true; | ||
/** @private {cast.receiver.CastMessageBus} */ | ||
@@ -243,2 +246,9 @@ this.shakaBus_ = null; | ||
shaka.cast.CastReceiver.prototype.onSendersChanged_ = function() { | ||
// Reset update message frequency values, to make sure whomever joined | ||
// will get a full update message. | ||
this.updateNumber_ = 0; | ||
// Don't reset startUpdatingUpdateNumber_, because this operation does not | ||
// result in new data being loaded. | ||
this.initialStatusUpdatePending_ = true; | ||
var manager = cast.receiver.CastReceiverManager.getInstance(); | ||
@@ -261,3 +271,5 @@ this.isConnected_ = manager.getSenders().length != 0; | ||
this.dispatchEvent(event); | ||
this.sendMediaStatus_(0); | ||
// Send a media status message, with a media info message if appropriate. | ||
if (!this.maybeSendMediaInfoMessage_()) | ||
this.sendMediaStatus_(0); | ||
}.bind(this)); | ||
@@ -407,2 +419,4 @@ }; | ||
}, this.shakaBus_); | ||
this.maybeSendMediaInfoMessage_(); | ||
}; | ||
@@ -412,2 +426,38 @@ | ||
/** | ||
* Composes and sends a mediaStatus message if appropriate. | ||
* @return {boolean} | ||
* @private | ||
*/ | ||
shaka.cast.CastReceiver.prototype.maybeSendMediaInfoMessage_ = function() { | ||
if (this.initialStatusUpdatePending_ && | ||
(this.video_.duration || this.player_.isLive())) { | ||
// Send over a media status message to set the duration of the cast | ||
// dialogue. | ||
this.sendMediaInfoMessage_(); | ||
this.initialStatusUpdatePending_ = false; | ||
return true; | ||
} | ||
return false; | ||
}; | ||
/** | ||
* Composes and sends a mediaStatus message with a mediaInfo component. | ||
* @private | ||
*/ | ||
shaka.cast.CastReceiver.prototype.sendMediaInfoMessage_ = function() { | ||
var media = { | ||
'contentId': this.player_.getManifestUri(), | ||
'streamType': this.player_.isLive() ? 'LIVE' : 'BUFFERED', | ||
'duration': this.video_.duration, | ||
// TODO: Is there a use case when this would be required? | ||
// Sending an empty string for now since it's a mandatory | ||
// field. | ||
'contentType': '' | ||
}; | ||
this.sendMediaStatus_(0, media); | ||
}; | ||
/** | ||
* Dispatch a fake 'volumechange' event to mimic the video element, since volume | ||
@@ -460,2 +510,3 @@ * changes are routed to the system volume on the receiver. | ||
this.startUpdatingUpdateNumber_ = false; | ||
this.initialStatusUpdatePending_ = true; | ||
@@ -514,2 +565,9 @@ this.initState_(message['initState'], message['appData']); | ||
var p = target[methodName].apply(target, args); | ||
if (targetName == 'player' && methodName == 'load') { | ||
// Wait until the manifest has actually loaded to send another media | ||
// info message, so on a new load it doesn't send the old info over. | ||
p = p.then(function() { | ||
this.initialStatusUpdatePending_ = true; | ||
}.bind(this)); | ||
} | ||
// Replies must go back to the specific sender who initiated, so that we | ||
@@ -590,2 +648,3 @@ // don't have to deal with conflicting IDs between senders. | ||
this.startUpdatingUpdateNumber_ = false; | ||
this.initialStatusUpdatePending_ = false; // This already sends an update. | ||
@@ -601,11 +660,3 @@ var mediaInfo = message['media']; | ||
// Notify generic controllers that the media has changed. | ||
var media = { | ||
'contentId': manifestUri, | ||
'streamType': this.player_.isLive() ? 'LIVE' : 'BUFFERED', | ||
// TODO: Is there a use case when this would be required? | ||
// Sending an empty string for now since it's a mandatory | ||
// field. | ||
'contentType': '' | ||
}; | ||
this.sendMediaStatus_(0, media); | ||
this.sendMediaInfoMessage_(); | ||
}.bind(this)).catch(function(error) { | ||
@@ -612,0 +663,0 @@ // Load failed. Dispatch the error message to the sender. |
@@ -22,2 +22,3 @@ /** | ||
goog.require('shaka.dash.ContentProtection'); | ||
goog.require('shaka.dash.MpdUtils'); | ||
goog.require('shaka.dash.SegmentBase'); | ||
@@ -857,3 +858,5 @@ goog.require('shaka.dash.SegmentList'); | ||
return; | ||
} else if (audio && video) { | ||
} | ||
if (audio && video) { | ||
// Audio+video variants | ||
@@ -1473,4 +1476,4 @@ var DrmEngine = shaka.media.DrmEngine; | ||
// http://goo.gl/CQFNJT | ||
// Some old ISO23009-1 drafts used 2012. | ||
case 'urn:mpeg:dash:utc:http-head:2014': | ||
// Some old ISO23009-1 drafts used 2012. | ||
case 'urn:mpeg:dash:utc:http-head:2012': | ||
@@ -1477,0 +1480,0 @@ return this.requestForTiming_(baseUris, value, 'HEAD'); |
@@ -23,2 +23,3 @@ /** | ||
goog.require('shaka.net.NetworkingEngine'); | ||
goog.require('shaka.util.Error'); | ||
goog.require('shaka.util.Functional'); | ||
@@ -25,0 +26,0 @@ goog.require('shaka.util.ManifestParserUtils'); |
@@ -338,3 +338,4 @@ /** | ||
// in StreamingEngine. | ||
var segmentEnd = Math.min(segmentStart + segmentDuration, periodDuration); | ||
var segmentEnd = segmentStart + segmentDuration; | ||
if (periodDuration) segmentEnd = Math.min(segmentEnd, periodDuration); | ||
@@ -341,0 +342,0 @@ // Do not construct segments references that should not exist. |
@@ -139,3 +139,3 @@ /** | ||
// Skip comments | ||
return; | ||
return []; | ||
} else { | ||
@@ -209,3 +209,3 @@ var uri = line.trim(); | ||
var regex = /([^=]+)=(?:"([^"]*)"|([^",]*))(?:,|$)/g; | ||
while (blockAttrs = parser.readRegex(regex)) { | ||
while ((blockAttrs = parser.readRegex(regex))) { | ||
var attrName = blockAttrs[1]; | ||
@@ -212,0 +212,0 @@ var attrValue = blockAttrs[2] || blockAttrs[3]; |
@@ -468,2 +468,3 @@ /** | ||
var clearKeyDrmInfo = this.configureClearKey_(); | ||
var configDrmInfos = this.getDrmInfosByConfig_(manifest); | ||
@@ -478,2 +479,10 @@ manifest.periods.forEach(function(period) { | ||
// If initial manifest contains unencrypted content, | ||
// drm configuration overrides DrmInfo so drmEngine can be activated. | ||
// Thus, player can play encrypted content if live stream switches from | ||
// unencrypted content to encrypted content during live stream. | ||
if (configDrmInfos) { | ||
variant.drmInfos = configDrmInfos; | ||
} | ||
variant.drmInfos.forEach(function(drmInfo) { | ||
@@ -780,2 +789,45 @@ this.fillInDrmInfoDefaults_(drmInfo); | ||
/** | ||
* Returns the DrmInfo that is generated by drm configation. | ||
* It activates DrmEngine if drm configs have keySystems. | ||
* @param {!shakaExtern.Manifest} manifest | ||
* @return {Array.<{shakaExtern.DrmInfo}>} | ||
* @private | ||
*/ | ||
shaka.media.DrmEngine.prototype.getDrmInfosByConfig_ = function(manifest) { | ||
var config = this.config_; | ||
var serverKeys = Object.keys(config.servers); | ||
if (!serverKeys.length) { | ||
return null; | ||
} | ||
var isEncryptedContent = manifest.periods.some(function(period) { | ||
return period.variants.some(function(variant) { | ||
return variant.drmInfos.length; | ||
}); | ||
}); | ||
// We only want to create phony DrmInfos | ||
// when none are provided by the manifest. | ||
if (isEncryptedContent) { | ||
return null; | ||
} | ||
return serverKeys.map(function(keySystem) { | ||
return { | ||
keySystem: keySystem, | ||
licenseServerUri: config.servers[keySystem], | ||
distinctiveIdentifierRequired: false, | ||
persistentStateRequired: false, | ||
audioRobustness: '', | ||
videoRobustness: '', | ||
serverCertificate: null, | ||
initData: [], | ||
keyIds: [] | ||
}; | ||
}); | ||
}; | ||
/** | ||
* Creates a DrmInfo object describing the settings used to initialize the | ||
@@ -782,0 +834,0 @@ * engine. |
@@ -441,3 +441,3 @@ /** | ||
} else if (this.transmuxers_[contentType]) { | ||
return this.transmuxers_[contentType].transmux(data, startTime).then( | ||
return this.transmuxers_[contentType].transmux(data).then( | ||
function(transmuxedData) { | ||
@@ -444,0 +444,0 @@ return this.enqueueOperation_(contentType, |
@@ -93,2 +93,5 @@ /** | ||
/** @private {boolean} */ | ||
this.seekingEventReceived_ = false; | ||
/** | ||
@@ -426,2 +429,10 @@ * Used to batch up early seeks and delay until video.currentTime is updated. | ||
if (this.video_.readyState == 0) return; | ||
// Do not gap jump if seeking has begun, but the seeking event has not | ||
// yet fired for this particular seek. | ||
if (this.video_.seeking) { | ||
if (!this.seekingEventReceived_) | ||
return; | ||
} else { | ||
this.seekingEventReceived_ = false; | ||
} | ||
// Don't gap jump while paused, so that you don't constantly jump ahead while | ||
@@ -568,2 +579,3 @@ // paused on a livestream. | ||
this.seekingEventReceived_ = true; | ||
this.hadSegmentAppended_ = false; | ||
@@ -570,0 +582,0 @@ var currentTime = this.video_.currentTime; |
@@ -212,1 +212,9 @@ /** | ||
}; | ||
/** | ||
* A convenient typedef for when either type of reference is acceptable. | ||
* | ||
* @typedef {shaka.media.InitSegmentReference|shaka.media.SegmentReference} | ||
*/ | ||
shaka.media.AnySegmentReference; |
@@ -38,3 +38,5 @@ /** | ||
/** @private {muxjs.mp4.Transmuxer} */ | ||
this.muxTransmuxer_ = new muxjs.mp4.Transmuxer(); | ||
this.muxTransmuxer_ = new muxjs.mp4.Transmuxer({ | ||
'keepOriginalTimestamps': true | ||
}); | ||
@@ -50,5 +52,2 @@ /** @private {shaka.util.PublicPromise} */ | ||
/** @private {boolean} */ | ||
this.baseDecodeTimeSet_ = false; | ||
this.muxTransmuxer_.on('data', this.onTransmuxed_.bind(this)); | ||
@@ -144,6 +143,5 @@ | ||
* @param {!ArrayBuffer} data | ||
* @param {?number} startTime | ||
* @return {!Promise.<!Uint8Array>} | ||
*/ | ||
shaka.media.Transmuxer.prototype.transmux = function(data, startTime) { | ||
shaka.media.Transmuxer.prototype.transmux = function(data) { | ||
goog.asserts.assert(!this.isTransmuxing_, | ||
@@ -155,9 +153,2 @@ 'No transmuxing should be in progress.'); | ||
// TODO: remove this once videojs/mux.js#168 is solved | ||
if (startTime != null && !this.baseDecodeTimeSet_) { | ||
var timescale = shaka.media.Transmuxer.TS_TIMESCALE_; | ||
this.muxTransmuxer_.setBaseMediaDecodeTime(startTime * timescale); | ||
this.baseDecodeTimeSet_ = true; | ||
} | ||
var dataArray = new Uint8Array(data); | ||
@@ -198,8 +189,1 @@ this.muxTransmuxer_.push(dataArray); | ||
}; | ||
/** | ||
* @const {number} | ||
* @private | ||
*/ | ||
shaka.media.Transmuxer.TS_TIMESCALE_ = 90000; |
@@ -37,3 +37,3 @@ /** | ||
return new Promise(function(resolve, reject) { | ||
var xhr = new XMLHttpRequest(); | ||
var xhr = new shaka.net.HttpPlugin.xhr_(); | ||
@@ -116,2 +116,11 @@ xhr.open(request.method, uri, true); | ||
/** | ||
* Overridden in unit tests, but compiled out in production. | ||
* | ||
* @const {function(new: XMLHttpRequest)} | ||
* @private | ||
*/ | ||
shaka.net.HttpPlugin.xhr_ = window.XMLHttpRequest; | ||
shaka.net.NetworkingEngine.registerScheme('http', shaka.net.HttpPlugin, | ||
@@ -118,0 +127,0 @@ shaka.net.NetworkingEngine.PluginPriority.FALLBACK); |
@@ -23,2 +23,4 @@ /** | ||
goog.require('shaka.offline.DBUpgrade'); | ||
goog.require('shaka.offline.DBUtils'); | ||
goog.require('shaka.util.ManifestParserUtils'); | ||
@@ -25,0 +27,0 @@ |
@@ -20,2 +20,3 @@ /** | ||
goog.require('shaka.log'); | ||
goog.require('shaka.util.Error'); | ||
@@ -202,2 +203,7 @@ goog.require('shaka.util.PublicPromise'); | ||
request.onerror = function(event) { | ||
shaka.log.error( | ||
'IndexedDB Failure', | ||
request.error.name, | ||
request.error.message); | ||
promise.reject(new shaka.util.Error( | ||
@@ -204,0 +210,0 @@ shaka.util.Error.Severity.CRITICAL, |
@@ -25,3 +25,5 @@ /** | ||
goog.require('shaka.media.SegmentReference'); | ||
goog.require('shaka.offline.OfflineUri'); | ||
goog.require('shaka.util.ManifestParserUtils'); | ||
goog.require('shaka.util.MapUtils'); | ||
goog.require('shaka.util.StreamUtils'); | ||
@@ -28,0 +30,0 @@ |
@@ -693,4 +693,6 @@ /** | ||
this.updateKeyStatus_('output-not-allowed'); | ||
break; | ||
default: | ||
this.updateKeyStatus_('internal-error'); | ||
break; | ||
} | ||
@@ -800,3 +802,6 @@ } | ||
/** @suppress {missingReturn} */ | ||
/** | ||
* @suppress {missingReturn} | ||
* @override | ||
*/ | ||
shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype. | ||
@@ -808,3 +813,6 @@ entries = function() { | ||
/** @suppress {missingReturn} */ | ||
/** | ||
* @suppress {missingReturn} | ||
* @override | ||
*/ | ||
shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype. | ||
@@ -816,3 +824,6 @@ keys = function() { | ||
/** @suppress {missingReturn} */ | ||
/** | ||
* @suppress {missingReturn} | ||
* @override | ||
*/ | ||
shaka.polyfill.PatchedMediaKeysMs.MediaKeyStatusMap.prototype. | ||
@@ -819,0 +830,0 @@ values = function() { |
@@ -747,4 +747,4 @@ /** | ||
this.media_[generateKeyRequestName](this.keySystem_, mangledInitData); | ||
} catch (exception) { | ||
this.generatePromise_.reject(exception); | ||
} catch (exception2) { | ||
this.generatePromise_.reject(exception2); | ||
this.generatePromise_ = null; | ||
@@ -1000,3 +1000,6 @@ } | ||
/** @suppress {missingReturn} */ | ||
/** | ||
* @suppress {missingReturn} | ||
* @override | ||
*/ | ||
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype. | ||
@@ -1008,3 +1011,6 @@ entries = function() { | ||
/** @suppress {missingReturn} */ | ||
/** | ||
* @suppress {missingReturn} | ||
* @override | ||
*/ | ||
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype. | ||
@@ -1016,3 +1022,6 @@ keys = function() { | ||
/** @suppress {missingReturn} */ | ||
/** | ||
* @suppress {missingReturn} | ||
* @override | ||
*/ | ||
shaka.polyfill.PatchedMediaKeysWebkit.MediaKeyStatusMap.prototype. | ||
@@ -1019,0 +1028,0 @@ values = function() { |
@@ -22,2 +22,3 @@ /** | ||
goog.require('shaka.log'); | ||
goog.require('shaka.text.Cue'); | ||
@@ -24,0 +25,0 @@ |
@@ -136,3 +136,3 @@ /** | ||
periodStart: 0, | ||
segmentStart: 0, | ||
segmentStart: null, | ||
segmentEnd: 0 | ||
@@ -139,0 +139,0 @@ }; |
@@ -62,27 +62,35 @@ /** | ||
var offset = time.segmentStart; | ||
// Parse X-TIMESTAMP-MAP metadata header if it's present to get | ||
// time offset information. | ||
// https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5 | ||
if (blocks[0].indexOf('X-TIMESTAMP-MAP') >= 0) { | ||
// 'X-TIMESTAMP-MAP' header is used in HLS to align text with | ||
// the rest of the media. | ||
// The header format is 'X-TIMESTAMP-MAP=MPEGTS:n,LOCAL:m' | ||
// (the attributes can go in any order) | ||
// where n is MPEG-2 time and m is cue time it maps to. | ||
// For example 'X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000' | ||
// means an offset of 10 seconds | ||
// 900000/MPEG_TIMESCALE - cue time. | ||
var cueTimeMatch = | ||
blocks[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m); | ||
if (offset == null) { | ||
// This is a probe, such as the HLS parser makes. We don't know the segment | ||
// start time, so we will use the X-TIMESTAMP-MAP header, if present, to get | ||
// the segment start time. By only doing this when segmentStart == null, we | ||
// protect against rollover in the MPEGTS field. | ||
var mpegTimeMatch = blocks[0].match(/MPEGTS:(\d+)/m); | ||
if (cueTimeMatch && mpegTimeMatch) { | ||
var parser = new shaka.util.TextParser(cueTimeMatch[1]); | ||
var cueTime = shaka.text.VttTextParser.parseTime_(parser); | ||
var mpegTime = Number(mpegTimeMatch[1]); | ||
var mpegTimescale = shaka.text.VttTextParser.MPEG_TIMESCALE_; | ||
// Apple-encoded HLS content uses absolute timestamps, so assume | ||
// the presence of the map tag means the content uses absolute | ||
// timestamps. | ||
offset = time.periodStart + (mpegTime / mpegTimescale - cueTime); | ||
// In case the attempt below doesn't work out, assume an offset of 0. | ||
offset = 0; | ||
if (blocks[0].indexOf('X-TIMESTAMP-MAP') >= 0) { | ||
// https://tools.ietf.org/html/draft-pantos-http-live-streaming-20#section-3.5 | ||
// 'X-TIMESTAMP-MAP' header is used in HLS to align text with | ||
// the rest of the media. | ||
// The header format is 'X-TIMESTAMP-MAP=MPEGTS:n,LOCAL:m' | ||
// (the attributes can go in any order) | ||
// where n is MPEG-2 time and m is cue time it maps to. | ||
// For example 'X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000' | ||
// means an offset of 10 seconds | ||
// 900000/MPEG_TIMESCALE - cue time. | ||
var cueTimeMatch = | ||
blocks[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m); | ||
var mpegTimeMatch = blocks[0].match(/MPEGTS:(\d+)/m); | ||
if (cueTimeMatch && mpegTimeMatch) { | ||
var parser = new shaka.util.TextParser(cueTimeMatch[1]); | ||
var cueTime = shaka.text.VttTextParser.parseTime_(parser); | ||
var mpegTime = Number(mpegTimeMatch[1]); | ||
var mpegTimescale = shaka.text.VttTextParser.MPEG_TIMESCALE_; | ||
// Apple-encoded HLS content uses absolute timestamps, so assume | ||
// the presence of the map tag means the content uses absolute | ||
// timestamps. | ||
offset = time.periodStart + (mpegTime / mpegTimescale - cueTime); | ||
} | ||
} | ||
@@ -187,6 +195,6 @@ } | ||
VttTextParser.setVerticalWritingDirection_(cue, results[1]); | ||
} else if ((results = /^size:([\d\.]+)%$/.exec(word))) { | ||
} else if ((results = /^size:([\d.]+)%$/.exec(word))) { | ||
cue.size = Number(results[1]); | ||
} else if ((results = | ||
/^position:([\d\.]+)%(?:,(line-left|line-right|center|start|end))?$/ | ||
/^position:([\d.]+)%(?:,(line-left|line-right|center|start|end))?$/ | ||
.exec(word))) { | ||
@@ -264,3 +272,3 @@ cue.position = Number(results[1]); | ||
var results = null; | ||
if ((results = /^line:([\d\.]+)%(?:,(start|end|center))?$/.exec(word))) { | ||
if ((results = /^line:([\d.]+)%(?:,(start|end|center))?$/.exec(word))) { | ||
cue.lineInterpretation = Cue.lineInterpretation.PERCENTAGE; | ||
@@ -267,0 +275,0 @@ cue.line = Number(results[1]); |
@@ -248,9 +248,9 @@ /** | ||
var codecs = []; | ||
if (videoCodec) { codecs.push(videoCodec); } | ||
if (audioCodec) { codecs.push(audioCodec); } | ||
if (videoCodec) codecs.push(videoCodec); | ||
if (audioCodec) codecs.push(audioCodec); | ||
/** @type {!Array.<string>} */ | ||
var mimeTypes = []; | ||
if (video) { mimeTypes.push(video.mimeType); } | ||
if (audio) { mimeTypes.push(audio.mimeType); } | ||
if (video) mimeTypes.push(video.mimeType); | ||
if (audio) mimeTypes.push(audio.mimeType); | ||
/** @type {?string} */ | ||
@@ -261,4 +261,4 @@ var mimeType = mimeTypes[0] || null; | ||
var kinds = []; | ||
if (audio) { kinds.push(audio.kind); } | ||
if (video) { kinds.push(video.kind); } | ||
if (audio) kinds.push(audio.kind); | ||
if (video) kinds.push(video.kind); | ||
/** @type {?string} */ | ||
@@ -269,4 +269,4 @@ var kind = kinds[0] || null; | ||
var roles = []; | ||
if (audio) { roles.push.apply(roles, audio.roles); } | ||
if (video) { roles.push.apply(roles, video.roles); } | ||
if (audio) roles.push.apply(roles, audio.roles); | ||
if (video) roles.push.apply(roles, video.roles); | ||
roles = shaka.util.ArrayUtils.removeDuplicates(roles); | ||
@@ -483,3 +483,3 @@ | ||
* | ||
* @param {shakaExtern.Period} period | ||
* @param {!Array.<shakaExtern.Variant>} variants | ||
* @param {string} preferredLanguage | ||
@@ -491,16 +491,20 @@ * @param {string} preferredRole | ||
shaka.util.StreamUtils.filterVariantsByLanguageAndRole = function( | ||
period, preferredLanguage, preferredRole, opt_languageMatches) { | ||
variants, preferredLanguage, preferredRole, opt_languageMatches) { | ||
var LanguageUtils = shaka.util.LanguageUtils; | ||
var ContentType = shaka.util.ManifestParserUtils.ContentType; | ||
var variants = shaka.util.StreamUtils.getPlayableVariants(period.variants); | ||
/** @type {!Array.<!shakaExtern.Variant>} */ | ||
var playable = shaka.util.StreamUtils.getPlayableVariants(variants); | ||
/** @type {!Array.<!shakaExtern.Variant>} */ | ||
var chosen = playable; | ||
// Start with the set of primary variants. | ||
/** @type {!Array.<!shakaExtern.Variant>} */ | ||
var chosen = variants.filter(function(variant) { | ||
var primary = playable.filter(function(variant) { | ||
return variant.primary; | ||
}); | ||
// If there were no primary variants, go back to all variants. | ||
if (!chosen.length) { | ||
chosen = variants; | ||
if (primary.length) { | ||
chosen = primary; | ||
} | ||
@@ -526,3 +530,3 @@ | ||
var betterLangMatchFound = false; | ||
variants.forEach(function(variant) { | ||
playable.forEach(function(variant) { | ||
pref = LanguageUtils.normalize(pref); | ||
@@ -573,5 +577,5 @@ var lang = LanguageUtils.normalize(variant.language); | ||
/** | ||
* Chooses text streams according to the given config. | ||
* Chooses streams according to the given config. | ||
* | ||
* @param {shakaExtern.Period} period | ||
* @param {!Array.<shakaExtern.Stream>} streams | ||
* @param {string} preferredLanguage | ||
@@ -582,17 +586,18 @@ * @param {string} preferredRole | ||
*/ | ||
shaka.util.StreamUtils.filterTextStreamsByLanguageAndRole = function( | ||
period, preferredLanguage, preferredRole, opt_languageMatches) { | ||
shaka.util.StreamUtils.filterStreamsByLanguageAndRole = function( | ||
streams, preferredLanguage, preferredRole, opt_languageMatches) { | ||
var LanguageUtils = shaka.util.LanguageUtils; | ||
var ContentType = shaka.util.ManifestParserUtils.ContentType; | ||
var streams = period.textStreams; | ||
/** @type {!Array.<!shakaExtern.Stream>} */ | ||
var chosen = streams; | ||
// Start with the set of primary streams. | ||
/** @type {!Array.<!shakaExtern.Stream>} */ | ||
var chosen = streams.filter(function(stream) { | ||
var primary = streams.filter(function(stream) { | ||
return stream.primary; | ||
}); | ||
// If there were no primary streams, go back to all streams. | ||
if (!chosen.length) { | ||
chosen = streams; | ||
if (primary.length) { | ||
chosen = primary; | ||
} | ||
@@ -643,2 +648,9 @@ | ||
} | ||
} else { | ||
// Prefer text streams with no roles, if they exist. | ||
var noRoleMatches = chosen.filter(function(stream) { | ||
return stream.roles.length == 0; | ||
}); | ||
if (noRoleMatches.length) | ||
return noRoleMatches; | ||
} | ||
@@ -645,0 +657,0 @@ |
@@ -120,3 +120,3 @@ /** | ||
// Format: YYYY-MM-DDThh:mm:ss.ssssss | ||
if (/^\d+\-\d+\-\d+T\d+:\d+:\d+(\.\d+)?$/.test(dateString)) | ||
if (/^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test(dateString)) | ||
dateString += 'Z'; | ||
@@ -252,3 +252,3 @@ | ||
var n; | ||
if (res = exprString.match(/^(\d+)\/(\d+)$/)) { | ||
if ((res = exprString.match(/^(\d+)\/(\d+)$/))) { | ||
n = Number(res[1] / res[2]); | ||
@@ -255,0 +255,0 @@ } else { |
{ | ||
"name": "shaka-player", | ||
"description": "DASH/EME video player library", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"homepage": "https://github.com/google/shaka-player", | ||
@@ -15,3 +15,7 @@ "author": "Google", | ||
"array-includes": "~3.0.3", | ||
"babel-core": "^6.26.0", | ||
"babel-preset-env": "^1.6.1", | ||
"es6-shim": "~0.35.3", | ||
"eslint": "^4.14.0", | ||
"eslint-config-google": "^0.9.1", | ||
"esprima": "~3.1.3", | ||
@@ -23,2 +27,3 @@ "htmlhint": "yaniswang/HTMLHint#152a114f", | ||
"karma": "~1.6.0", | ||
"karma-babel-preprocessor": "^7.0.0", | ||
"karma-chrome-launcher": "~2.0.0", | ||
@@ -33,5 +38,6 @@ "karma-coverage": "~1.1.1", | ||
"karma-safari-launcher": "~1.0.0", | ||
"karma-source-map-support": "^1.2.0", | ||
"karma-spec-reporter": "~0.0.31", | ||
"karma-webdriver-launcher": "~1.0.5", | ||
"mux.js": "~4.2.1", | ||
"mux.js": "~4.4.0", | ||
"requirejs": "~2.3.3", | ||
@@ -38,0 +44,0 @@ "rimraf": "~2.6.1", |
@@ -86,3 +86,3 @@ # ![Shaka Player](docs/shaka-player-logo.png) | ||
- ISO-BMFF / MP4 / CMAF support | ||
- MPEG-2 TS support (transmuxing provided by [mux.js][], must be separately included) | ||
- MPEG-2 TS support (transmuxing provided by [mux.js][] v4.4+, must be separately included) | ||
- WebVTT and TTML | ||
@@ -138,3 +138,3 @@ | ||
- MPEG-2 TS | ||
- With help from [mux.js][], can be played on any browser which supports MP4 | ||
- With help from [mux.js][] v4.4+, can be played on any browser which supports MP4 | ||
- Can find and parse timestamps to find segment start time in HLS | ||
@@ -141,0 +141,0 @@ - WebVTT |
@@ -145,3 +145,3 @@ /** | ||
}, | ||
'playerAfterLoad': { | ||
playerAfterLoad: { | ||
setTextTrackVisibility: true | ||
@@ -321,3 +321,3 @@ }, | ||
CastReceiverManager: { | ||
getInstance: function() { return mockReceiverManager; } | ||
getInstance: function() { return mockReceiverManager; } | ||
} | ||
@@ -324,0 +324,0 @@ }; |
@@ -311,3 +311,3 @@ /** | ||
}, | ||
'playerAfterLoad': { | ||
playerAfterLoad: { | ||
setTextTrackVisibility: true | ||
@@ -689,2 +689,126 @@ }, | ||
describe('sends duration', function() { | ||
beforeEach(function(done) { | ||
checkChromeOrChromecast(); | ||
receiver = new CastReceiver( | ||
mockVideo, mockPlayer, Util.spyFunc(mockAppDataCallback)); | ||
fakeConnectedSenders(1); | ||
mockPlayer.load = function() { | ||
mockVideo.duration = 1; | ||
mockPlayer.getManifestUri = function() { | ||
return 'URI A'; | ||
}; | ||
return Promise.resolve(); | ||
}; | ||
fakeIncomingMessage({ | ||
type: 'init', | ||
initState: { manifest: 'URI A' }, | ||
appData: {} | ||
}, mockShakaMessageBus); | ||
// The messages will show up asychronously: | ||
Util.delay(0.1).then(function() { | ||
expectMediaInfo('URI A', 1); | ||
mockGenericMessageBus.messages = []; | ||
}).then(done); | ||
}); | ||
it('only once, if nothing else changes', function(done) { | ||
checkChromeOrChromecast(); | ||
Util.delay(0.5).then(function() { | ||
expect(mockGenericMessageBus.messages.length).toBe(0); | ||
}).then(done); | ||
}); | ||
it('after new sender connects', function(done) { | ||
checkChromeOrChromecast(); | ||
fakeConnectedSenders(1); | ||
Util.delay(0.5).then(function() { | ||
expectMediaInfo('URI A', 1); | ||
expect(mockGenericMessageBus.messages.length).toBe(0); | ||
}).then(done); | ||
}); | ||
it('for correct manifest after loading new manifest', function(done) { | ||
checkChromeOrChromecast(); | ||
// Change media information, but only after half a second. | ||
mockPlayer.load = function() { | ||
return Util.delay(0.5).then(function() { | ||
mockVideo.duration = 2; | ||
mockPlayer.getManifestUri = function() { | ||
return 'URI B'; | ||
}; | ||
}); | ||
}; | ||
fakeIncomingMessage({ | ||
type: 'asyncCall', | ||
id: '5', | ||
targetName: 'player', | ||
methodName: 'load', | ||
args: ['URI B'] | ||
}, mockShakaMessageBus, 'senderId'); | ||
// Wait for the mockPlayer to finish 'loading' before checking again. | ||
Util.delay(1.0).then(function() { | ||
expectMediaInfo('URI B', 2); // pollAttributes_ | ||
expect(mockGenericMessageBus.messages.length).toBe(0); | ||
}).then(done); | ||
}); | ||
it('after LOAD system message', function(done) { | ||
checkChromeOrChromecast(); | ||
mockPlayer.load = function() { | ||
mockVideo.duration = 2; | ||
mockPlayer.getManifestUri = function() { | ||
return 'URI B'; | ||
}; | ||
return Promise.resolve(); | ||
}; | ||
var message = { | ||
// Arbitrary number | ||
'requestId': 0, | ||
'type': 'LOAD', | ||
'autoplay': false, | ||
'currentTime': 10, | ||
'media': { | ||
'contentId': 'URI B', | ||
'contentType': 'video/mp4', | ||
'streamType': 'BUFFERED' | ||
} | ||
}; | ||
fakeIncomingMessage(message, mockGenericMessageBus); | ||
Util.delay(0.5).then(function() { | ||
expectMediaInfo('URI B', 2); | ||
expect(mockGenericMessageBus.messages.length).toBe(0); | ||
}).then(done); | ||
}); | ||
function expectMediaInfo(expectedUri, expectedDuration) { | ||
expect(mockGenericMessageBus.messages.length).toBeGreaterThan(0); | ||
if (mockGenericMessageBus.messages.length == 0) | ||
return; | ||
expect(mockGenericMessageBus.messages[0]).toEqual( | ||
{ | ||
requestId: 0, | ||
type: 'MEDIA_STATUS', | ||
status: [jasmine.objectContaining({ | ||
media: { | ||
contentId: expectedUri, | ||
streamType: 'BUFFERED', | ||
duration: expectedDuration, | ||
contentType: '' | ||
} | ||
})] | ||
} | ||
); | ||
mockGenericMessageBus.messages.shift(); | ||
} | ||
}); | ||
describe('respects generic control messages', function() { | ||
@@ -867,3 +991,3 @@ beforeEach(function() { | ||
CastReceiverManager: { | ||
getInstance: function() { return mockReceiverManager; } | ||
getInstance: function() { return mockReceiverManager; } | ||
} | ||
@@ -870,0 +994,0 @@ }; |
@@ -230,3 +230,5 @@ /** | ||
// Representation 2 key ID | ||
'deadbeeffeedbaadf00d000008675309'])]); | ||
'deadbeeffeedbaadf00d000008675309', | ||
]) | ||
]); | ||
testDashParser(done, source, expected); | ||
@@ -252,4 +254,4 @@ }); | ||
['bm8gaHVtYW4gY2FuIHJlYWQgYmFzZTY0IGRpcmVjdGx5'], // initData | ||
['deadbeeffeedbaadf00d000008675309'])] // key Id for initData | ||
); | ||
['deadbeeffeedbaadf00d000008675309']) // key Id for initData | ||
]); | ||
testDashParser(done, source, expected); | ||
@@ -282,3 +284,5 @@ }); | ||
// Representation 2 key ID | ||
'baadf00dfeeddeafbeef018006492568'])]); | ||
'baadf00dfeeddeafbeef018006492568', | ||
]) | ||
]); | ||
testDashParser(done, source, expected); | ||
@@ -299,11 +303,10 @@ }); | ||
], [], []); | ||
var expected = buildExpectedManifest( | ||
[ | ||
buildDrmInfo('com.widevine.alpha', [], [ | ||
'ZmFrZSBXaWRldmluZSBQU1NI' | ||
]), | ||
buildDrmInfo('com.microsoft.playready', [], [ | ||
'bm8gaHVtYW4gY2FuIHJlYWQgYmFzZTY0IGRpcmVjdGx5' | ||
]) | ||
]); | ||
var expected = buildExpectedManifest([ | ||
buildDrmInfo('com.widevine.alpha', [], [ | ||
'ZmFrZSBXaWRldmluZSBQU1NI' | ||
]), | ||
buildDrmInfo('com.microsoft.playready', [], [ | ||
'bm8gaHVtYW4gY2FuIHJlYWQgYmFzZTY0IGRpcmVjdGx5' | ||
]) | ||
]); | ||
testDashParser(done, source, expected); | ||
@@ -516,7 +519,10 @@ }); | ||
var expected = buildExpectedManifest([ | ||
buildDrmInfo('', [ // placeholder: only unrecognized schemes found | ||
// Representation 1 key ID | ||
'deadbeeffeedbaadf00d000008675309', | ||
// Representation 2 key ID | ||
'deadbeeffeedbaadf00d000008675309'])]); | ||
buildDrmInfo('', // placeholder: only unrecognized schemes found | ||
[ | ||
// Representation 1 key ID | ||
'deadbeeffeedbaadf00d000008675309', | ||
// Representation 2 key ID | ||
'deadbeeffeedbaadf00d000008675309', | ||
]) | ||
]); | ||
testDashParser(done, source, expected); | ||
@@ -584,3 +590,5 @@ }); | ||
// Representation 2 key ID | ||
'baadf00dfeeddeafbeef000004390116'])]); | ||
'baadf00dfeeddeafbeef000004390116', | ||
]), | ||
]); | ||
testDashParser(done, source, expected); | ||
@@ -613,3 +621,4 @@ }); | ||
// Representation 2 key ID | ||
'baadf00dfeeddeafbeef000004390116']; | ||
'baadf00dfeeddeafbeef000004390116', | ||
]; | ||
var expected = buildExpectedManifest( | ||
@@ -616,0 +625,0 @@ [ |
@@ -1003,2 +1003,25 @@ /** | ||
describe('SegmentTemplate w/ duration', function() { | ||
var templateLines = [ | ||
'<SegmentTemplate startNumber="1" media="s$Number$.mp4" duration="2" />' | ||
]; | ||
it('produces sane references without assertions', function(done) { | ||
var manifest = makeSimpleLiveManifestText(templateLines, updateTime); | ||
fakeNetEngine.setResponseMapAsText({'dummy://foo': manifest}); | ||
parser.start('dummy://foo', playerInterface).then(function(manifest) { | ||
expect(manifest.periods.length).toBe(1); | ||
var stream = manifest.periods[0].variants[0].video; | ||
// In https://github.com/google/shaka-player/issues/1204, this | ||
// failed an assertion and returned endTime == 0. | ||
var ref = stream.getSegmentReference(1); | ||
expect(ref.endTime).toBeGreaterThan(0); | ||
}).catch(fail).then(done); | ||
shaka.polyfill.Promise.flush(); | ||
}); | ||
}); | ||
describe('EventStream', function() { | ||
@@ -1005,0 +1028,0 @@ /** @const */ |
@@ -66,3 +66,4 @@ /** | ||
' </Period>', | ||
'</MPD>'].join('\n'); | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -102,3 +103,4 @@ fakeNetEngine.setResponseMapAsText({ | ||
' </Period>', | ||
'</MPD>'].join('\n'); | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -135,3 +137,4 @@ fakeNetEngine.setResponseMapAsText({ | ||
' </Period>', | ||
'</MPD>'].join('\n'); | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -169,3 +172,4 @@ fakeNetEngine.setResponseMapAsText({ | ||
' </Period>', | ||
'</MPD>'].join('\n'); | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -210,3 +214,4 @@ fakeNetEngine.setResponseMapAsText({ | ||
' </Period>', | ||
'</MPD>'].join('\n'); | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -250,3 +255,4 @@ fakeNetEngine.setResponseMapAsText({ | ||
' </Period>', | ||
'</MPD>'].join('\n'); | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -284,3 +290,4 @@ fakeNetEngine.setResponseMapAsText({ | ||
' </Period>', | ||
'</MPD>'].join('\n'); | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -319,3 +326,3 @@ fakeNetEngine.setResponseMap({ | ||
' </Period>', | ||
'</MPD>' | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -340,3 +347,3 @@ var error = new shaka.util.Error( | ||
' </Period>', | ||
'</MPD>' | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -363,3 +370,3 @@ var error = new shaka.util.Error( | ||
' </Period>', | ||
'</MPD>' | ||
'</MPD>', | ||
].join('\n'); | ||
@@ -366,0 +373,0 @@ var error = new shaka.util.Error( |
@@ -679,3 +679,3 @@ /** | ||
'</ToReplace>'; | ||
return sprintf(format, {var : variable, link : link}); | ||
return sprintf(format, {'var': variable, 'link': link}); | ||
} | ||
@@ -682,0 +682,0 @@ |
@@ -43,6 +43,14 @@ /** | ||
/** @type {ArrayBuffer} */ | ||
var initSegmentData; | ||
/** @type {ArrayBuffer} */ | ||
var segmentData; | ||
/** @type {ArrayBuffer} */ | ||
var selfInitializingSegmentData; | ||
/** @type {ArrayBuffer} */ | ||
var tsSegmentData; | ||
/** @type {ArrayBuffer} */ | ||
var pastRolloverSegmentData; | ||
/** @const {number} */ | ||
var rolloverOffset; | ||
/** @const {number} */ | ||
var segmentDataStartTime; | ||
@@ -52,2 +60,18 @@ | ||
// TODO: use StreamGenerator? | ||
initSegmentData = new Uint8Array([ | ||
0x00, 0x00, 0x00, 0x30, // size (48) | ||
0x6D, 0x6F, 0x6F, 0x76, // type (moov) | ||
0x00, 0x00, 0x00, 0x28, // trak size (40) | ||
0x74, 0x72, 0x61, 0x6B, // type (trak) | ||
0x00, 0x00, 0x00, 0x20, // mdia size (32) | ||
0x6D, 0x64, 0x69, 0x61, // type (mdia) | ||
0x00, 0x00, 0x00, 0x18, // mdhd size (24) | ||
0x6D, 0x64, 0x68, 0x64, // type (mdhd) | ||
0x00, 0x00, 0x00, 0x00, // version and flags | ||
0x00, 0x00, 0x00, 0x00, // creation time (0) | ||
0x00, 0x00, 0x00, 0x00, // modification time (0) | ||
0x00, 0x00, 0x03, 0xe8, // timescale (1000) | ||
]).buffer; | ||
segmentData = new Uint8Array([ | ||
@@ -62,3 +86,3 @@ 0x00, 0x00, 0x00, 0x24, // size (36) | ||
0x00, 0x00, 0x00, 0x00, // baseMediaDecodeTime first 4 bytes | ||
0x00, 0x02, 0xBF, 0x20 // baseMediaDecodeTime last 4 bytes (180000) | ||
0x00, 0x00, 0x07, 0xd0 // baseMediaDecodeTime last 4 bytes (2000) | ||
]).buffer; | ||
@@ -80,2 +104,22 @@ tsSegmentData = new Uint8Array([ | ||
pastRolloverSegmentData = new Uint8Array([ | ||
0x00, 0x00, 0x00, 0x24, // size (36) | ||
0x6D, 0x6F, 0x6F, 0x66, // type (moof) | ||
0x00, 0x00, 0x00, 0x1C, // traf size (28) | ||
0x74, 0x72, 0x61, 0x66, // type (traf) | ||
0x00, 0x00, 0x00, 0x14, // tfdt size (20) | ||
0x74, 0x66, 0x64, 0x74, // type (tfdt) | ||
0x01, 0x00, 0x00, 0x00, // version and flags | ||
0x00, 0x00, 0x00, 0x00, // baseMediaDecodeTime first 4 bytes | ||
0x0b, 0x60, 0xbc, 0x28 // baseMediaDecodeTime last 4 bytes (190889000) | ||
]).buffer; | ||
// The timestamp above would roll over twice, so this rollover offset should | ||
// be applied. | ||
rolloverOffset = (0x200000000 * 2) / 90000; | ||
selfInitializingSegmentData = shaka.util.Uint8ArrayUtils.concat( | ||
new Uint8Array(initSegmentData), | ||
new Uint8Array(segmentData)).buffer; | ||
fakeNetEngine = new shaka.test.FakeNetworkingEngine(); | ||
@@ -127,3 +171,5 @@ | ||
'test:/audio': toUTF8(initialMedia), | ||
'test:/main.mp4': segmentData | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData, | ||
'test:/selfInit.mp4': selfInitializingSegmentData, | ||
}); | ||
@@ -166,3 +212,3 @@ parser.start('test:/master', playerInterface) | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:2,\n', | ||
@@ -176,3 +222,3 @@ 'test:/main.mp4\n' | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:2,\n', | ||
@@ -188,2 +234,3 @@ 'test:/main.mp4\n', | ||
'test:/video': toUTF8(media + '#EXT-X-ENDLIST'), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -279,2 +326,3 @@ }); | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -310,2 +358,3 @@ }); | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -331,2 +380,3 @@ }); | ||
'test:/video': toUTF8(media + '#EXT-X-ENDLIST'), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -340,4 +390,4 @@ }); | ||
}); | ||
}); | ||
}); | ||
}); // describe('update') | ||
}); // describe('playlist type EVENT') | ||
@@ -348,2 +398,3 @@ describe('playlist type LIVE', function() { | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MEDIA-SEQUENCE:0\n', | ||
@@ -357,2 +408,3 @@ '#EXTINF:2,\n', | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:2,\n', | ||
@@ -365,2 +417,3 @@ 'test:/main.mp4\n' | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MEDIA-SEQUENCE:0\n', | ||
@@ -378,2 +431,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MEDIA-SEQUENCE:0\n', | ||
@@ -389,2 +443,3 @@ '#EXTINF:2,\n', | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MEDIA-SEQUENCE:1\n', | ||
@@ -399,2 +454,3 @@ '#EXTINF:2,\n', | ||
'test:/video': toUTF8(media + '#EXT-X-ENDLIST'), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -412,2 +468,3 @@ }); | ||
'test:/video': toUTF8(mediaWithoutSequenceNumber), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -419,2 +476,48 @@ }); | ||
it('offsets VTT text with rolled over TS timestamps', function(done) { | ||
var masterWithVtt = [ | ||
'#EXTM3U\n', | ||
'#EXT-X-MEDIA:TYPE=SUBTITLES,LANGUAGE="fra",URI="test:/text"\n', | ||
'#EXT-X-STREAM-INF:BANDWIDTH=200,CODECS="avc1",', | ||
'RESOLUTION=960x540,FRAME-RATE=60\n', | ||
'test:/video\n', | ||
].join(''); | ||
var textPlaylist = [ | ||
'#EXTM3U\n', | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MEDIA-SEQUENCE:0\n', | ||
'#EXTINF:2,\n', | ||
'test:/main.vtt\n', | ||
].join(''); | ||
var vtt = [ | ||
'WEBVTT\n', | ||
'\n', | ||
'00:00.000 --> 00:01.000\n', | ||
'Hello, world!\n', | ||
].join(''); | ||
fakeNetEngine.setResponseMap({ | ||
'test:/master': toUTF8(masterWithVtt), | ||
'test:/video': toUTF8(media), | ||
'test:/text': toUTF8(textPlaylist), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': pastRolloverSegmentData, | ||
'test:/main.vtt': toUTF8(vtt), | ||
}); | ||
parser.start('test:/master', playerInterface).then(function(manifest) { | ||
var textStream = manifest.periods[0].textStreams[0]; | ||
var ref = textStream.getSegmentReference(0); | ||
expect(ref).not.toBe(null); | ||
expect(ref.startTime).not.toBeLessThan(rolloverOffset); | ||
var videoStream = manifest.periods[0].variants[0].video; | ||
ref = videoStream.getSegmentReference(0); | ||
expect(ref).not.toBe(null); | ||
expect(ref.startTime).not.toBeLessThan(rolloverOffset); | ||
}).catch(fail).then(done); | ||
}); | ||
describe('update', function() { | ||
@@ -472,2 +575,3 @@ beforeAll(function() { | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -494,2 +598,3 @@ }); | ||
'test:/video': toUTF8(mediaWithAdditionalSegment), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -513,2 +618,3 @@ }); | ||
'test:/video': toUTF8(mediaWithRemovedSegment), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData, | ||
@@ -564,2 +670,3 @@ 'test:/main2.mp4': segmentData | ||
'test:/video': toUTF8(mediaWithByteRange), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -591,4 +698,92 @@ }); | ||
}); | ||
}); | ||
}); | ||
}); | ||
it('handles rollover on update', function(done) { | ||
var masterWithVtt = [ | ||
'#EXTM3U\n', | ||
'#EXT-X-MEDIA:TYPE=SUBTITLES,LANGUAGE="fra",URI="test:/text"\n', | ||
'#EXT-X-STREAM-INF:BANDWIDTH=200,CODECS="avc1",', | ||
'RESOLUTION=960x540,FRAME-RATE=60\n', | ||
'test:/video\n', | ||
].join(''); | ||
var textPlaylist1 = [ | ||
'#EXTM3U\n', | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MEDIA-SEQUENCE:0\n', | ||
'#EXTINF:2,\n', | ||
'test:/main1.vtt\n', | ||
].join(''); | ||
var textPlaylist2 = [ | ||
'#EXTM3U\n', | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MEDIA-SEQUENCE:0\n', | ||
'#EXTINF:2,\n', | ||
'test:/main1.vtt\n', | ||
'#EXTINF:2,\n', | ||
'test:/main2.vtt\n', | ||
].join(''); | ||
// ~0.7s from rollover | ||
var vtt1 = [ | ||
'WEBVTT\n', | ||
'X-TIMESTAMP-MAP=MPEGTS:8589870000,LOCAL:00:00:00.000\n', | ||
'\n', | ||
'00:00.000 --> 00:01.000\n', | ||
'Hello, world!\n', | ||
].join(''); | ||
// ~1.3s after rollover | ||
var vtt2 = [ | ||
'WEBVTT\n', | ||
'X-TIMESTAMP-MAP=MPEGTS:115408,LOCAL:00:00:00.000\n', | ||
'\n', | ||
'00:00.000 --> 00:01.000\n', | ||
'Hello, again!\n', | ||
].join(''); | ||
fakeNetEngine.setResponseMap({ | ||
'test:/master': toUTF8(masterWithVtt), | ||
'test:/video': toUTF8(media), | ||
'test:/text': toUTF8(textPlaylist1), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': pastRolloverSegmentData, | ||
'test:/main1.vtt': toUTF8(vtt1), | ||
}); | ||
var baseTime = 95443 + rolloverOffset; | ||
var ref1 = ManifestParser.makeReference('test:/main1.vtt', | ||
/* position */ 0, | ||
/* startTime */ baseTime, | ||
/* endTime */ baseTime + 2); | ||
var ref2 = ManifestParser.makeReference('test:/main2.vtt', | ||
/* position */ 1, | ||
/* startTime */ baseTime + 2, | ||
/* endTime */ baseTime + 4); | ||
parser.start('test:/master', playerInterface).then(function(manifest) { | ||
var text = manifest.periods[0].textStreams[0]; | ||
ManifestParser.verifySegmentIndex(text, [ref1]); | ||
fakeNetEngine.setResponseMap({ | ||
'test:/master': toUTF8(masterWithVtt), | ||
'test:/video': toUTF8(mediaWithAdditionalSegment), | ||
'test:/text': toUTF8(textPlaylist2), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': pastRolloverSegmentData, | ||
'test:/main2.mp4': pastRolloverSegmentData, | ||
'test:/main1.vtt': toUTF8(vtt1), | ||
'test:/main2.vtt': toUTF8(vtt2), | ||
}); | ||
fakeNetEngine.request.calls.reset(); | ||
delayForUpdatePeriod(); | ||
ManifestParser.verifySegmentIndex(text, [ref1, ref2]); | ||
}).catch(fail).then(done); | ||
shaka.polyfill.Promise.flush(); | ||
}); | ||
}); // describe('update') | ||
}); // describe('playlist type LIVE') | ||
}); // describe('HlsParser live') |
@@ -18,3 +18,2 @@ /** | ||
describe('HlsParser', function() { | ||
@@ -38,3 +37,7 @@ /** @const */ | ||
/** @type {ArrayBuffer} */ | ||
var initSegmentData; | ||
/** @type {ArrayBuffer} */ | ||
var segmentData; | ||
/** @type {ArrayBuffer} */ | ||
var selfInitializingSegmentData; | ||
/** @const {string} */ | ||
@@ -50,2 +53,19 @@ var vttText = [ | ||
// TODO: use StreamGenerator? | ||
initSegmentData = new Uint8Array([ | ||
0x00, 0x00, 0x00, 0x30, // size (48) | ||
0x6D, 0x6F, 0x6F, 0x76, // type (moov) | ||
0x00, 0x00, 0x00, 0x28, // trak size (40) | ||
0x74, 0x72, 0x61, 0x6B, // type (trak) | ||
0x00, 0x00, 0x00, 0x20, // mdia size (32) | ||
0x6D, 0x64, 0x69, 0x61, // type (mdia) | ||
0x00, 0x00, 0x00, 0x18, // mdhd size (24) | ||
0x6D, 0x64, 0x68, 0x64, // type (mdhd) | ||
0x00, 0x00, 0x00, 0x00, // version and flags | ||
0x00, 0x00, 0x00, 0x00, // creation time (0) | ||
0x00, 0x00, 0x00, 0x00, // modification time (0) | ||
0x00, 0x00, 0x03, 0xe8, // timescale (1000) | ||
]).buffer; | ||
segmentData = new Uint8Array([ | ||
@@ -56,5 +76,7 @@ 0x00, 0x00, 0x00, 0x24, // size (36) | ||
0x74, 0x72, 0x61, 0x66, // type (traf) | ||
0x00, 0x00, 0x00, 0x14, // tfdt size (20) | ||
0x74, 0x66, 0x64, 0x74, // type (tfdt) | ||
0x01, 0x00, 0x00, 0x00, // version and flags | ||
0x00, 0x00, 0x00, 0x00, // baseMediaDecodeTime first 4 bytes (0) | ||
@@ -65,2 +87,6 @@ 0x00, 0x00, 0x00, 0x00 // baseMediaDecodeTime last 4 bytes (0) | ||
selfInitializingSegmentData = shaka.util.Uint8ArrayUtils.concat( | ||
new Uint8Array(initSegmentData), | ||
new Uint8Array(segmentData)).buffer; | ||
fakeNetEngine = new shaka.test.FakeNetworkingEngine(); | ||
@@ -106,4 +132,6 @@ | ||
'test:/main.vtt': toUTF8(vttText), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData, | ||
'test:/main.test': segmentData | ||
'test:/main.test': segmentData, | ||
'test:/selfInit.mp4': selfInitializingSegmentData, | ||
}); | ||
@@ -128,3 +156,3 @@ | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -163,3 +191,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -196,3 +224,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -232,3 +260,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -276,3 +304,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -311,3 +339,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -347,3 +375,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -385,3 +413,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -434,3 +462,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -496,3 +524,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -554,3 +582,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -565,2 +593,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -589,3 +618,3 @@ }); | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -640,3 +669,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -697,2 +726,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'test:/main.vtt': toUTF8(vttText), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -723,3 +753,3 @@ }); | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -780,2 +810,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'test:/main.vtt': toUTF8(vttText), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -802,3 +833,3 @@ }); | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -835,2 +866,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'test:/text': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -857,3 +889,3 @@ }); | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -899,2 +931,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'test:/main.foo': toUTF8(vttText), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -920,3 +953,3 @@ }); | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -989,3 +1022,5 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'test:/host/video/video.m3u8': toUTF8(media), | ||
'test:/host/audio/init.mp4': initSegmentData, | ||
'test:/host/audio/segment.mp4': segmentData, | ||
'test:/host/video/init.mp4': initSegmentData, | ||
'test:/host/video/segment.mp4': segmentData | ||
@@ -1037,3 +1072,3 @@ }); | ||
'#EXT-X-BYTERANGE:121090@616\n', | ||
'test:/main.mp4' | ||
'test:/selfInit.mp4' | ||
].join(''); | ||
@@ -1078,6 +1113,7 @@ | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-KEY:METHOD=SAMPLE-AES-CENC,', | ||
'#EXT-X-KEY:METHOD=SAMPLE-AES-CTR,', | ||
'KEYFORMAT="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed",', | ||
'URI="data:text/plain;base64,', | ||
initDataBase64, '",\n', | ||
'#EXT-X-MAP:URI="init.mp4"\n', | ||
'#EXTINF:5,\n', | ||
@@ -1095,3 +1131,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
.anySegmentFunctions() | ||
.nullInitSegment() | ||
.anyInitSegment() | ||
.presentationTimeOffset(0) | ||
@@ -1124,2 +1160,3 @@ .mime('video/mp4', 'avc1') | ||
'test:/main.exe': segmentData, | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -1147,4 +1184,4 @@ }); | ||
'#EXTM3U\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
@@ -1175,3 +1212,3 @@ '#EXTINF:5,\n', | ||
'#EXTM3U\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
@@ -1203,3 +1240,3 @@ '#EXTINF:5,\n', | ||
'#EXTM3U\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
@@ -1249,3 +1286,3 @@ '#EXTINF:5,\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -1271,3 +1308,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4"\n', | ||
'#EXTINF:5,\n', | ||
@@ -1311,3 +1348,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-BYTERANGE:121090@616\n', | ||
@@ -1338,2 +1375,3 @@ 'test:/main.mp4' | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="init.mp4"\n', | ||
'#EXTINF:5,\n', | ||
@@ -1363,3 +1401,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
0x00, 0x00, 0x00, 0x00, // baseMediaDecodeTime first 4 bytes | ||
0x00, 0x02, 0xBF, 0x20 // baseMediaDecodeTime last 4 bytes (180000) | ||
0x00, 0x00, 0x07, 0xd0 // baseMediaDecodeTime last 4 bytes (2000) | ||
]).buffer; | ||
@@ -1378,3 +1416,4 @@ tsSegmentData = new Uint8Array([ | ||
]).buffer; | ||
// 180000 divided by TS timescale (90000) = segment starts at 2s. | ||
// 180000 (TS PTS) divided by fixed TS timescale (90000) = 2s. | ||
// 2000 (MP4 PTS) divided by parsed MP4 timescale (1000) = 2s. | ||
segmentDataStartTime = 2; | ||
@@ -1387,2 +1426,3 @@ }); | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -1456,2 +1496,3 @@ }); | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -1487,2 +1528,3 @@ }); | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="init.mp4"\n', | ||
'#EXTINF:5,\n', | ||
@@ -1495,2 +1537,3 @@ 'test:/main.mp4' | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -1515,2 +1558,3 @@ }); | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="init.mp4"\n', | ||
'#EXTINF:5,\n', | ||
@@ -1524,2 +1568,3 @@ 'test:/main.mp4\n', | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -1544,2 +1589,3 @@ }); | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="init.mp4"\n', | ||
'#EXTINF:5,\n', | ||
@@ -1553,2 +1599,3 @@ 'test:/main.mp4\n', | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -1574,2 +1621,3 @@ }); | ||
'#EXT-X-TARGETDURATION:5\n', | ||
'#EXT-X-MAP:URI="init.mp4"\n', | ||
'#EXTINF:5,\n', | ||
@@ -1583,2 +1631,3 @@ 'test:/main.mp4?foo=bar\n', | ||
'test:/video': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4?foo=bar': segmentData | ||
@@ -1609,3 +1658,3 @@ }); | ||
'#EXT-X-PLAYLIST-TYPE:VOD\n', | ||
'#EXT-X-MAP:URI="test:/main.mp4",BYTERANGE="616@0"\n', | ||
'#EXT-X-MAP:URI="test:/init.mp4",BYTERANGE="616@0"\n', | ||
'#EXTINF:5,\n', | ||
@@ -1621,2 +1670,3 @@ '#EXT-X-BYTERANGE:121090@616\n', | ||
'test:/audio': toUTF8(media), | ||
'test:/init.mp4': initSegmentData, | ||
'test:/main.mp4': segmentData | ||
@@ -1623,0 +1673,0 @@ }); |
@@ -25,3 +25,2 @@ /** | ||
* }} | ||
* gjslint: disable=900 | ||
*/ | ||
@@ -45,3 +44,2 @@ var MockTimeRanges; | ||
* }} | ||
* gjslint: disable=900 | ||
*/ | ||
@@ -48,0 +46,0 @@ var MockSourceBuffer; |
@@ -18,4 +18,2 @@ /** | ||
goog.require('shaka.test.Util'); | ||
describe('Mp4SegmentIndexParser', function() { | ||
@@ -22,0 +20,0 @@ var indexSegmentUri = '/base/test/test/assets/index-segment.mp4'; |
@@ -1016,2 +1016,30 @@ /** | ||
it('doesn\'t gap jump if the seeking event is late', function() { | ||
var buffered = [{start: 10, end: 20}]; | ||
video.buffered = createFakeBuffered(buffered); | ||
video.currentTime = 12; | ||
video.readyState = HTMLMediaElement.HAVE_ENOUGH_DATA; | ||
config.jumpLargeGaps = true; | ||
playhead = new shaka.media.Playhead(video, manifest, config, 12, | ||
Util.spyFunc(onSeek), | ||
Util.spyFunc(onEvent)); | ||
jasmine.clock().tick(1000); | ||
expect(onEvent).not.toHaveBeenCalled(); | ||
// Append a segment before seeking. | ||
playhead.onSegmentAppended(); | ||
// Seek backwards but wait briefly to fire the seeking event. | ||
video.currentTime = 3; | ||
video.readyState = HTMLMediaElement.HAVE_METADATA; | ||
video.seeking = true; | ||
jasmine.clock().tick(600); | ||
video.on['seeking'](); | ||
// There should NOT have been a gap jump. | ||
expect(video.currentTime).toBe(3); | ||
}); | ||
/** | ||
@@ -1018,0 +1046,0 @@ * @param {string} name |
@@ -833,3 +833,3 @@ /** | ||
var timeout = shaka.test.Util.delay(30).then(function() { | ||
throw 'Timeout waiting for time'; | ||
throw new Error('Timeout waiting for time'); | ||
}); | ||
@@ -836,0 +836,0 @@ return Promise.race([p, timeout]); |
@@ -103,3 +103,3 @@ /** | ||
var sawMDAT = false; | ||
transmuxer.transmux(videoSegment, 0).then(function(transmuxedData) { | ||
transmuxer.transmux(videoSegment).then(function(transmuxedData) { | ||
expect(transmuxedData instanceof Uint8Array).toBe(true); | ||
@@ -119,3 +119,3 @@ expect(transmuxedData.length).toBeGreaterThan(0); | ||
var sawMDAT = false; | ||
transmuxer.transmux(audioSegment, 0).then(function(transmuxedData) { | ||
transmuxer.transmux(audioSegment).then(function(transmuxedData) { | ||
expect(transmuxedData instanceof Uint8Array).toBe(true); | ||
@@ -135,3 +135,3 @@ expect(transmuxedData.length).toBeGreaterThan(0); | ||
var sawMDAT = false; | ||
transmuxer.transmux(emptySegment, 0).then(function(transmuxedData) { | ||
transmuxer.transmux(emptySegment).then(function(transmuxedData) { | ||
expect(transmuxedData instanceof Uint8Array).toBe(true); | ||
@@ -148,8 +148,8 @@ expect(transmuxedData.length).toBeGreaterThan(0); | ||
it('offsets output timestamps', function(done) { | ||
it('passes through true timestamps', function(done) { | ||
var parsed = false; | ||
var expectedMp4Timestamp = 123 * 90000; // timescale units | ||
var expectedMp4Timestamp = 5166000; // in timescale units | ||
var mp4Timestamp; | ||
transmuxer.transmux(videoSegment, 123).then(function(transmuxedData) { | ||
transmuxer.transmux(videoSegment).then(function(transmuxedData) { | ||
var Mp4Parser = shaka.util.Mp4Parser; | ||
@@ -156,0 +156,0 @@ |
@@ -18,4 +18,2 @@ /** | ||
goog.require('shaka.test.Util'); | ||
describe('WebmSegmentIndexParser', function() { | ||
@@ -22,0 +20,0 @@ var indexSegmentUri = '/base/test/test/assets/index-segment.webm'; |
@@ -23,3 +23,12 @@ /** | ||
beforeAll(function() { | ||
// Install the mock only briefly in the global namespace, to get a handle to | ||
// the mocked XHR implementation. | ||
jasmine.Ajax.install(); | ||
var MockXHR = window.XMLHttpRequest; | ||
jasmine.Ajax.uninstall(); | ||
// Now plug this mock into HttpRequest directly, so it does not interfere | ||
// with other requests, such as those made by karma frameworks like | ||
// source-map-support. | ||
shaka.net.HttpPlugin['xhr_'] = MockXHR; | ||
jasmine.clock().install(); | ||
@@ -77,3 +86,3 @@ | ||
afterAll(function() { | ||
jasmine.Ajax.uninstall(); | ||
shaka.net.HttpPlugin['xhr_'] = window.XMLHttpRequest; | ||
jasmine.clock().uninstall(); | ||
@@ -80,0 +89,0 @@ }); |
@@ -327,3 +327,3 @@ /** | ||
var timeout = shaka.test.Util.delay(30).then(function() { | ||
throw 'Timeout waiting for time'; | ||
throw new Error('Timeout waiting for time'); | ||
}); | ||
@@ -330,0 +330,0 @@ return Promise.race([p, timeout]); |
@@ -445,3 +445,3 @@ /** | ||
function findVariant(variants, audioId, videoId) { | ||
/*** @type {?shakaExtern.Variant} */ | ||
/** @type {?shakaExtern.Variant} */ | ||
var found = null; | ||
@@ -448,0 +448,0 @@ |
@@ -297,2 +297,6 @@ /** | ||
// Use a double-cast to get the compiler to allow this. | ||
var invalidFunction = /** @type {function(*)} */( | ||
/** @type {*} */(undefined)); | ||
p.then(function() { return 1; }) | ||
@@ -312,3 +316,3 @@ .then(function(i) { expect(i).toBe(1); }) | ||
.then(fail) | ||
.catch() | ||
.catch(invalidFunction) | ||
.then(fail) | ||
@@ -315,0 +319,0 @@ .catch(function() {}) |
@@ -52,3 +52,2 @@ /** | ||
* @type {{failedExpectations: !Array}} | ||
* gjslint: disable=900 | ||
*/ | ||
@@ -55,0 +54,0 @@ jasmine.Spec.prototype.result; |
@@ -266,3 +266,3 @@ /** | ||
// Cast to the ContentType enum for compatibility. | ||
type = /**@type {shaka.util.ManifestParserUtils.ContentType} */( | ||
type = /** @type {shaka.util.ManifestParserUtils.ContentType} */( | ||
'trickvideo'); | ||
@@ -290,3 +290,3 @@ } | ||
// Cast to the ContentType enum for compatibility. | ||
type = /**@type {shaka.util.ManifestParserUtils.ContentType} */( | ||
type = /** @type {shaka.util.ManifestParserUtils.ContentType} */( | ||
'trickvideo'); | ||
@@ -363,3 +363,4 @@ } | ||
this.clearImpl_( | ||
/**@type {shaka.util.ManifestParserUtils.ContentType} */('trickvideo')); | ||
/** @type {shaka.util.ManifestParserUtils.ContentType} */( | ||
'trickvideo')); | ||
} | ||
@@ -366,0 +367,0 @@ |
@@ -20,3 +20,3 @@ /** | ||
goog.require('shaka.util.StringUtils'); | ||
/** @fileoverview @suppress {missingRequire} */ | ||
@@ -23,0 +23,0 @@ |
@@ -20,4 +20,3 @@ /** | ||
goog.require('shaka.media.SegmentReference'); | ||
goog.require('shaka.test.FakeNetworkingEngine'); | ||
/** @fileoverview @suppress {missingRequire} */ | ||
@@ -24,0 +23,0 @@ |
@@ -30,3 +30,3 @@ /** | ||
shaka.test.TestScheme = function(uri, request) { | ||
var manifestParts = /^test:([^\/]+)$/.exec(uri); | ||
var manifestParts = /^test:([^/]+)$/.exec(uri); | ||
if (manifestParts) { | ||
@@ -41,3 +41,3 @@ /** @type {shakaExtern.Response} */ | ||
} | ||
var re = /^test:([^\/]+)\/(video|audio)\/(init|[0-9]+)$/; | ||
var re = /^test:([^/]+)\/(video|audio)\/(init|[0-9]+)$/; | ||
var segmentParts = re.exec(uri); | ||
@@ -379,28 +379,26 @@ if (!segmentParts) { | ||
if (true) { // The linter complains without the "if" (i.e. for plain blocks) | ||
var data = DATA['sintel']; | ||
var period_duration = 10; | ||
var num_periods = 10; | ||
var gen = new windowShaka.test.ManifestGenerator(shaka) | ||
.setPresentationDuration(period_duration * num_periods); | ||
var data = DATA['sintel']; | ||
var period_duration = 10; | ||
var num_periods = 10; | ||
var gen = new windowShaka.test.ManifestGenerator(shaka) | ||
.setPresentationDuration(period_duration * num_periods); | ||
for (var i = 0; i < num_periods; i++) { | ||
gen.addPeriod(period_duration * i); | ||
for (var i = 0; i < num_periods; i++) { | ||
gen.addPeriod(period_duration * i); | ||
gen.addVariant(2 * i).language('en'); | ||
gen.addVideo(4 * i); | ||
addStreamInfo(gen, data, ContentType.VIDEO, 'sintel'); | ||
gen.addAudio(4 * i + 1); | ||
addStreamInfo(gen, data, ContentType.AUDIO, 'sintel'); | ||
gen.addVariant(2 * i).language('en'); | ||
gen.addVideo(4 * i); | ||
addStreamInfo(gen, data, ContentType.VIDEO, 'sintel'); | ||
gen.addAudio(4 * i + 1); | ||
addStreamInfo(gen, data, ContentType.AUDIO, 'sintel'); | ||
gen.addVariant(2 * i + 1).language('es'); | ||
gen.addVideo(4 * i + 2); | ||
addStreamInfo(gen, data, ContentType.VIDEO, 'sintel'); | ||
gen.addAudio(4 * i + 3); | ||
addStreamInfo(gen, data, ContentType.AUDIO, 'sintel'); | ||
} | ||
MANIFESTS['sintel_short_periods' + suffix] = gen.build(); | ||
gen.addVariant(2 * i + 1).language('es'); | ||
gen.addVideo(4 * i + 2); | ||
addStreamInfo(gen, data, ContentType.VIDEO, 'sintel'); | ||
gen.addAudio(4 * i + 3); | ||
addStreamInfo(gen, data, ContentType.AUDIO, 'sintel'); | ||
} | ||
MANIFESTS['sintel_short_periods' + suffix] = gen.build(); | ||
return Promise.all(async); | ||
@@ -431,3 +429,3 @@ }; | ||
function(uri, playerInterface) { | ||
var re = /^test:([^\/]+)$/; | ||
var re = /^test:([^/]+)$/; | ||
var manifestParts = re.exec(uri); | ||
@@ -434,0 +432,0 @@ if (!manifestParts) { |
@@ -507,3 +507,3 @@ /** | ||
it('respects X-TIMESTAMP-MAP header', function() { | ||
it('respects X-TIMESTAMP-MAP header in probes', function() { | ||
verifyHelper( | ||
@@ -522,5 +522,25 @@ [ | ||
'Test2', | ||
{ periodStart: 0, segmentStart: 0, segmentEnd: 0 }); | ||
// segmentStart of null marks this as a probe. | ||
{ periodStart: 0, segmentStart: null, segmentEnd: 0 }); | ||
}); | ||
it('ignores X-TIMESTAMP-MAP header when segment times are known', function() { | ||
verifyHelper( | ||
[ | ||
{start: 120, end: 140, payload: 'Test'}, | ||
{start: 140, end: 150, payload: 'Test2'} | ||
] , | ||
// 900000 = 10 sec, so expect every timestamp to be 10 | ||
// seconds ahead of what is specified. | ||
'WEBVTT\n' + | ||
'X-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000\n\n' + | ||
'00:00:20.000 --> 00:00:40.000 line:0\n' + | ||
'Test\n\n' + | ||
'00:00:40.000 --> 00:00:50.000 line:-1\n' + | ||
'Test2', | ||
// Non-null segmentStart takes precedence over X-TIMESTAMP-MAP. | ||
// This protects us from rollover in the MPEGTS field. | ||
{ periodStart: 0, segmentStart: 100, segmentEnd: 0 }); | ||
}); | ||
it('skips style blocks', function() { | ||
@@ -527,0 +547,0 @@ verifyHelper( |
@@ -55,3 +55,3 @@ /** | ||
sed: null, | ||
'do': undefined, | ||
do_: undefined, | ||
eiusmod: [] | ||
@@ -58,0 +58,0 @@ } |
@@ -123,3 +123,4 @@ /** | ||
try { | ||
new shaka.util.Pssh(psshs[i]); | ||
var pssh = new shaka.util.Pssh(psshs[i]); | ||
expect(pssh).toBeTruthy(); // Closure: don't complain about unused vars | ||
fail(); | ||
@@ -126,0 +127,0 @@ } catch (error) { |
@@ -22,7 +22,7 @@ /** | ||
shaka.util.StreamUtils.filterVariantsByLanguageAndRole; | ||
var filterTextStreamsByLanguageAndRole = | ||
shaka.util.StreamUtils.filterTextStreamsByLanguageAndRole; | ||
var filterStreamsByLanguageAndRole = | ||
shaka.util.StreamUtils.filterStreamsByLanguageAndRole; | ||
describe('filterVariantsByLanguageAndRole', function() { | ||
it("chooses variants in user's preferred language", function() { | ||
it('chooses variants in user\'s preferred language', function() { | ||
manifest = new shaka.test.ManifestGenerator() | ||
@@ -38,4 +38,6 @@ .addPeriod(0) | ||
var chosen = filterVariantsByLanguageAndRole(manifest.periods[0], | ||
'en', ''); | ||
var chosen = filterVariantsByLanguageAndRole( | ||
manifest.periods[0].variants, | ||
'en', | ||
''); | ||
expect(chosen.length).toBe(2); | ||
@@ -57,4 +59,6 @@ expect(chosen[0]).toBe(manifest.periods[0].variants[1]); | ||
var chosen = filterVariantsByLanguageAndRole(manifest.periods[0], | ||
'en', ''); | ||
var chosen = filterVariantsByLanguageAndRole( | ||
manifest.periods[0].variants, | ||
'en', | ||
''); | ||
expect(chosen.length).toBe(2); | ||
@@ -76,4 +80,6 @@ expect(chosen[0]).toBe(manifest.periods[0].variants[0]); | ||
var chosen = filterVariantsByLanguageAndRole(manifest.periods[0], | ||
'en', ''); | ||
var chosen = filterVariantsByLanguageAndRole( | ||
manifest.periods[0].variants, | ||
'en', | ||
''); | ||
expect(chosen.length).toBe(1); | ||
@@ -97,4 +103,6 @@ expect(chosen[0]).toBe(manifest.periods[0].variants[2]); | ||
var chosen = filterVariantsByLanguageAndRole(manifest.periods[0], | ||
'en', 'main'); | ||
var chosen = filterVariantsByLanguageAndRole( | ||
manifest.periods[0].variants, | ||
'en', | ||
'main'); | ||
expect(chosen.length).toBe(1); | ||
@@ -128,4 +136,6 @@ expect(chosen[0]).toBe(manifest.periods[0].variants[0]); | ||
var chosen = filterVariantsByLanguageAndRole(manifest.periods[0], | ||
'en', ''); | ||
var chosen = filterVariantsByLanguageAndRole( | ||
manifest.periods[0].variants, | ||
'en', | ||
''); | ||
// Which role is chosen is an implementation detail. | ||
@@ -161,4 +171,6 @@ // Each role is found on two variants, so we should have two. | ||
var chosen = filterVariantsByLanguageAndRole(manifest.periods[0], | ||
'zh', ''); | ||
var chosen = filterVariantsByLanguageAndRole( | ||
manifest.periods[0].variants, | ||
'zh', | ||
''); | ||
// Which role is chosen is an implementation detail. | ||
@@ -188,4 +200,6 @@ // Each role is found on two variants, so we should have two. | ||
var chosen = filterVariantsByLanguageAndRole(manifest.periods[0], | ||
'zh', ''); | ||
var chosen = filterVariantsByLanguageAndRole( | ||
manifest.periods[0].variants, | ||
'zh', | ||
''); | ||
// Which language is chosen is an implementation detail. | ||
@@ -221,4 +235,6 @@ // Each role is found on two variants, so we should have two. | ||
var chosen = filterVariantsByLanguageAndRole(manifest.periods[0], | ||
'zh', ''); | ||
var chosen = filterVariantsByLanguageAndRole( | ||
manifest.periods[0].variants, | ||
'zh', | ||
''); | ||
// Which role is chosen is an implementation detail. | ||
@@ -259,4 +275,6 @@ // Each role is found on two variants, so we should have two. | ||
var chosen = filterVariantsByLanguageAndRole(manifest.periods[0], | ||
'zh', ''); | ||
var chosen = filterVariantsByLanguageAndRole( | ||
manifest.periods[0].variants, | ||
'zh', | ||
''); | ||
expect(chosen.length).toBe(2); | ||
@@ -270,4 +288,4 @@ expect(chosen[0].language).toBe('zh'); | ||
describe('filterTextStreamsByLanguageAndRole', function() { | ||
it("chooses text streams in user's preferred language", function() { | ||
describe('filterStreamsByLanguageAndRole', function() { | ||
it('chooses text streams in user\'s preferred language', function() { | ||
manifest = new shaka.test.ManifestGenerator() | ||
@@ -283,4 +301,6 @@ .addPeriod(0) | ||
var chosen = filterTextStreamsByLanguageAndRole(manifest.periods[0], | ||
'en', ''); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'en', | ||
''); | ||
expect(chosen.length).toBe(2); | ||
@@ -301,4 +321,6 @@ expect(chosen[0]).toBe(manifest.periods[0].textStreams[0]); | ||
var chosen = filterTextStreamsByLanguageAndRole(manifest.periods[0], | ||
'en', ''); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'en', | ||
''); | ||
expect(chosen.length).toBe(2); | ||
@@ -322,4 +344,6 @@ expect(chosen[0]).toBe(manifest.periods[0].textStreams[1]); | ||
var chosen = filterTextStreamsByLanguageAndRole(manifest.periods[0], | ||
'en', 'main'); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'en', | ||
'main'); | ||
expect(chosen.length).toBe(1); | ||
@@ -329,2 +353,44 @@ expect(chosen[0]).toBe(manifest.periods[0].textStreams[0]); | ||
it('prefers no-role streams if there is no preferred role', function() { | ||
manifest = new shaka.test.ManifestGenerator() | ||
.addPeriod(0) | ||
.addTextStream(0) | ||
.language('en') | ||
.roles(['commentary']) | ||
.addTextStream(1) | ||
.language('en') | ||
.addTextStream(2) | ||
.language('en') | ||
.roles(['secondary']) | ||
.build(); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'en', | ||
''); | ||
expect(chosen.length).toBe(1); | ||
expect(chosen[0].roles.length).toBe(0); // Pick a stream with no role. | ||
}); | ||
it('ignores no-role streams if there is a preferred role', function() { | ||
manifest = new shaka.test.ManifestGenerator() | ||
.addPeriod(0) | ||
.addTextStream(0) | ||
.language('en') | ||
.roles(['commentary']) | ||
.addTextStream(1) | ||
.language('en') | ||
.addTextStream(2) | ||
.language('en') | ||
.roles(['secondary']) | ||
.build(); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'en', | ||
'main'); // A role that is not present. | ||
expect(chosen.length).toBe(1); | ||
expect(chosen[0].roles.length).toBe(1); // Pick a stream with a role. | ||
}); | ||
it('chooses only one role, even if none is preferred', function() { | ||
@@ -354,4 +420,6 @@ // Regression test for https://github.com/google/shaka-player/issues/949 | ||
var chosen = filterTextStreamsByLanguageAndRole(manifest.periods[0], | ||
'en', ''); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'en', | ||
''); | ||
// Which role is chosen is an implementation detail. | ||
@@ -387,4 +455,6 @@ // Each role is found on two text streams, so we should have two. | ||
var chosen = filterTextStreamsByLanguageAndRole(manifest.periods[0], | ||
'zh', ''); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'zh', | ||
''); | ||
// Which role is chosen is an implementation detail. | ||
@@ -410,4 +480,6 @@ // Each role is found on two text streams, so we should have two. | ||
var chosen = filterTextStreamsByLanguageAndRole(manifest.periods[0], | ||
'zh', ''); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'zh', | ||
''); | ||
// Which language is chosen is an implementation detail. | ||
@@ -443,4 +515,6 @@ // Each role is found on two variants, so we should have two. | ||
var chosen = filterTextStreamsByLanguageAndRole(manifest.periods[0], | ||
'zh', ''); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'zh', | ||
''); | ||
// Which role is chosen is an implementation detail. | ||
@@ -481,4 +555,6 @@ // Each role is found on two text streams, so we should have two. | ||
var chosen = filterTextStreamsByLanguageAndRole(manifest.periods[0], | ||
'zh', ''); | ||
var chosen = filterStreamsByLanguageAndRole( | ||
manifest.periods[0].textStreams, | ||
'zh', | ||
''); | ||
expect(chosen.length).toBe(2); | ||
@@ -485,0 +561,0 @@ expect(chosen[0].language).toBe('zh'); |
closure/compiler.jar | ||
The closure compiler, v20170423, by Google. | ||
The closure compiler, v20171203, by Google. | ||
Apache v2.0 license. | ||
https://github.com/google/closure-compiler | ||
closure/linter.jar | ||
The closure compiler linter, v20171203, by Google. | ||
Apache v2.0 license. | ||
https://github.com/google/closure-compiler | ||
closure/goog | ||
The closure library (modified), by Google. | ||
The closure library (modified), possibly v20150315, by Google. | ||
Apache v2.0 license. | ||
https://github.com/google/closure-library | ||
Local mods: | ||
- Library stripped down to just dependency management & URI parsing | ||
@@ -16,12 +23,2 @@ closure/deps | ||
gjslint/closure_linter-2.3.13 | ||
The closure JavaScript linter, by Google. | ||
Apache v2.0 license. | ||
https://code.google.com/p/closure-linter/ | ||
gjslint/python-gflags-2.0 | ||
A python command-line parser, needed by the closure linter, by Google. | ||
BSD-style license (3-clause). | ||
https://code.google.com/p/python-gflags/ | ||
jsdoc | ||
@@ -31,1 +28,9 @@ JSDoc 3 documentation generator (modified), by Michael Matthews. | ||
https://github.com/jsdoc3/jsdoc | ||
Local mods: | ||
- Show tutorials in sorted order, as named in the JSON index | ||
- Hide tutorial "child" links | ||
- Added support for custom annotations like exportDoc, exportInterface | ||
- Add support for linking to source code | ||
- Add enum values in generated HTML | ||
- Add support for focusing enum values by URL fragment | ||
- Fixed crash when a type implements and overrides something like toString() |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
24801490
3
96754
31
474