shaka-player
Advanced tools
Comparing version 4.10.2 to 4.10.3
@@ -774,48 +774,48 @@ | ||
shaka.ui.Locales.Ids = { | ||
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN', | ||
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE', | ||
PLAY: 'PLAY', | ||
AIRPLAY: 'AIRPLAY', | ||
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME', | ||
CAPTIONS: 'CAPTIONS', | ||
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE', | ||
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE', | ||
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE', | ||
SKIP_AD: 'SKIP_AD', | ||
STATISTICS: 'STATISTICS', | ||
LOOP: 'LOOP', | ||
QUALITY: 'QUALITY', | ||
REPLAY: 'REPLAY', | ||
SKIP_TO_LIVE: 'SKIP_TO_LIVE', | ||
UNRECOGNIZED_LANGUAGE: 'UNRECOGNIZED_LANGUAGE', | ||
QUALITY: 'QUALITY', | ||
AUTO_QUALITY: 'AUTO_QUALITY', | ||
UNMUTE: 'UNMUTE', | ||
RECENTER_VR: 'RECENTER_VR', | ||
REWIND: 'REWIND', | ||
PLAYBACK_RATE: 'PLAYBACK_RATE', | ||
FULL_SCREEN: 'FULL_SCREEN', | ||
FAST_FORWARD: 'FAST_FORWARD', | ||
EXIT_FULL_SCREEN: 'EXIT_FULL_SCREEN', | ||
SEEK: 'SEEK', | ||
EXIT_LOOP_MODE: 'EXIT_LOOP_MODE', | ||
VOLUME: 'VOLUME', | ||
AUTO_QUALITY: 'AUTO_QUALITY', | ||
SURROUND: 'SURROUND', | ||
MULTIPLE_LANGUAGES: 'MULTIPLE_LANGUAGES', | ||
BACK: 'BACK', | ||
DOWNLOAD_VIDEO_FRAME: 'DOWNLOAD_VIDEO_FRAME', | ||
AD_DURATION: 'AD_DURATION', | ||
PLAY: 'PLAY', | ||
RESOLUTION: 'RESOLUTION', | ||
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC', | ||
RECENTER_VR: 'RECENTER_VR', | ||
AD_TIME: 'AD_TIME', | ||
CAST: 'CAST', | ||
MUTE: 'MUTE', | ||
AD_TIME: 'AD_TIME', | ||
AD_STATISTICS: 'AD_STATISTICS', | ||
OFF: 'OFF', | ||
ON: 'ON', | ||
PLAYBACK_RATE: 'PLAYBACK_RATE', | ||
SUBTITLE_FORCED: 'SUBTITLE_FORCED', | ||
NOT_APPLICABLE: 'NOT_APPLICABLE', | ||
PAUSE: 'PAUSE', | ||
LANGUAGE: 'LANGUAGE', | ||
MORE_SETTINGS: 'MORE_SETTINGS', | ||
LANGUAGE: 'LANGUAGE', | ||
FAST_FORWARD: 'FAST_FORWARD', | ||
RESOLUTION: 'RESOLUTION', | ||
CAST: 'CAST', | ||
SURROUND: 'SURROUND', | ||
ON: 'ON', | ||
AIRPLAY: 'AIRPLAY', | ||
PICTURE_IN_PICTURE: 'PICTURE_IN_PICTURE', | ||
CAPTIONS: 'CAPTIONS', | ||
OFF: 'OFF', | ||
VOLUME: 'VOLUME', | ||
EXIT_PICTURE_IN_PICTURE: 'EXIT_PICTURE_IN_PICTURE', | ||
REWIND: 'REWIND', | ||
STATISTICS: 'STATISTICS', | ||
LIVE: 'LIVE', | ||
AD_DURATION: 'AD_DURATION', | ||
BACK: 'BACK', | ||
AD_PROGRESS: 'AD_PROGRESS', | ||
SKIP_TO_LIVE: 'SKIP_TO_LIVE', | ||
ENTER_PICTURE_IN_PICTURE: 'ENTER_PICTURE_IN_PICTURE', | ||
PAUSE: 'PAUSE', | ||
TOGGLE_STEREOSCOPIC: 'TOGGLE_STEREOSCOPIC', | ||
UNDETERMINED_LANGUAGE: 'UNDETERMINED_LANGUAGE', | ||
REPLAY: 'REPLAY', | ||
LIVE: 'LIVE', | ||
ENTER_LOOP_MODE: 'ENTER_LOOP_MODE', | ||
FULL_SCREEN: 'FULL_SCREEN', | ||
LOOP: 'LOOP', | ||
}; |
@@ -111,3 +111,4 @@ /*! @license | ||
for (const interstitial of interstitials) { | ||
if ((seekRange.start - interstitial.startTime) >= 1) { | ||
const comparisonTime = interstitial.endTime || interstitial.startTime; | ||
if ((seekRange.start - comparisonTime) >= 1) { | ||
if (this.preloadManagerInterstitials_.has(interstitial)) { | ||
@@ -114,0 +115,0 @@ const preloadManager = |
@@ -221,3 +221,9 @@ /*! @license | ||
baseBox = box.name; | ||
Mp4Parser.visualSampleEntry(box); | ||
const parsedVisualSampleEntryBox = | ||
shaka.util.Mp4BoxParsers.visualSampleEntry(box.reader); | ||
width = String(parsedVisualSampleEntryBox.width); | ||
height = String(parsedVisualSampleEntryBox.height); | ||
if (box.reader.hasMoreData()) { | ||
Mp4Parser.children(box); | ||
} | ||
}; | ||
@@ -228,11 +234,2 @@ | ||
.box('trak', Mp4Parser.children) | ||
.fullBox('tkhd', (box) => { | ||
goog.asserts.assert( | ||
box.version != null, | ||
'TKHD is a full box and should have a valid version.'); | ||
const parsedTKHDBox = shaka.util.Mp4BoxParsers.parseTKHD( | ||
box.reader, box.version); | ||
height = String(parsedTKHDBox.height); | ||
width = String(parsedTKHDBox.width); | ||
}) | ||
.box('mdia', Mp4Parser.children) | ||
@@ -239,0 +236,0 @@ .fullBox('mdhd', (box) => { |
@@ -8,4 +8,4 @@ /*! @license | ||
goog.provide('shaka.text.Cue'); | ||
goog.provide('shaka.text.CueRegion'); | ||
goog.require('shaka.text.CueRegion'); | ||
goog.require('shaka.util.ArrayUtils'); | ||
@@ -557,117 +557,1 @@ | ||
}; | ||
/** | ||
* @export | ||
*/ | ||
shaka.text.CueRegion = class { | ||
/** */ | ||
constructor() { | ||
const CueRegion = shaka.text.CueRegion; | ||
/** | ||
* Region identifier. | ||
* @type {string} | ||
* @export | ||
*/ | ||
this.id = ''; | ||
/** | ||
* The X offset to start the rendering area in viewportAnchorUnits of the | ||
* video width. | ||
* @type {number} | ||
* @export | ||
*/ | ||
this.viewportAnchorX = 0; | ||
/** | ||
* The X offset to start the rendering area in viewportAnchorUnits of the | ||
* video height. | ||
* @type {number} | ||
* @export | ||
*/ | ||
this.viewportAnchorY = 0; | ||
/** | ||
* The X offset to start the rendering area in percentage (0-100) of this | ||
* region width. | ||
* @type {number} | ||
* @export | ||
*/ | ||
this.regionAnchorX = 0; | ||
/** | ||
* The Y offset to start the rendering area in percentage (0-100) of the | ||
* region height. | ||
* @type {number} | ||
* @export | ||
*/ | ||
this.regionAnchorY = 0; | ||
/** | ||
* The width of the rendering area in widthUnits. | ||
* @type {number} | ||
* @export | ||
*/ | ||
this.width = 100; | ||
/** | ||
* The width of the rendering area in heightUnits. | ||
* @type {number} | ||
* @export | ||
*/ | ||
this.height = 100; | ||
/** | ||
* The units (percentage, pixels or lines) the region height is in. | ||
* @type {shaka.text.CueRegion.units} | ||
* @export | ||
*/ | ||
this.heightUnits = CueRegion.units.PERCENTAGE; | ||
/** | ||
* The units (percentage or pixels) the region width is in. | ||
* @type {shaka.text.CueRegion.units} | ||
* @export | ||
*/ | ||
this.widthUnits = CueRegion.units.PERCENTAGE; | ||
/** | ||
* The units (percentage or pixels) the region viewportAnchors are in. | ||
* @type {shaka.text.CueRegion.units} | ||
* @export | ||
*/ | ||
this.viewportAnchorUnits = CueRegion.units.PERCENTAGE; | ||
/** | ||
* If scroll=UP, it means that cues in the region will be added to the | ||
* bottom of the region and will push any already displayed cues in the | ||
* region up. Otherwise (scroll=NONE) cues will stay fixed at the location | ||
* they were first painted in. | ||
* @type {shaka.text.CueRegion.scrollMode} | ||
* @export | ||
*/ | ||
this.scroll = CueRegion.scrollMode.NONE; | ||
} | ||
}; | ||
/** | ||
* @enum {number} | ||
* @export | ||
*/ | ||
shaka.text.CueRegion.units = { | ||
'PX': 0, | ||
'PERCENTAGE': 1, | ||
'LINES': 2, | ||
}; | ||
/** | ||
* @enum {string} | ||
* @export | ||
*/ | ||
shaka.text.CueRegion.scrollMode = { | ||
'NONE': '', | ||
'UP': 'up', | ||
}; |
@@ -471,3 +471,5 @@ /*! @license | ||
const linesUnit = shaka.text.CueRegion.units.LINES; | ||
const percentageUnit = shaka.text.CueRegion.units.PERCENTAGE; | ||
const pixelUnit = shaka.text.CueRegion.units.PX; | ||
const heightUnit = region.heightUnits == percentageUnit ? '%' : 'px'; | ||
@@ -483,8 +485,10 @@ const widthUnit = region.widthUnits == percentageUnit ? '%' : 'px'; | ||
const linesUnit = shaka.text.CueRegion.units.LINES; | ||
if (region.heightUnits === linesUnit && region.widthUnits === linesUnit) { | ||
if (region.heightUnits === linesUnit) { | ||
regionElement.style.height = region.height * lineHeightMultiple + '%'; | ||
} else { | ||
regionElement.style.height = region.height + heightUnit; | ||
} | ||
if (region.widthUnits === linesUnit) { | ||
regionElement.style.width = region.width * lineWidthMultiple + '%'; | ||
} else { | ||
regionElement.style.height = region.height + heightUnit; | ||
regionElement.style.width = region.width + widthUnit; | ||
@@ -509,2 +513,15 @@ } | ||
} | ||
if (region.heightUnits !== pixelUnit && | ||
region.widthUnits !== pixelUnit && | ||
region.viewportAnchorUnits !== pixelUnit) { | ||
// Clip region | ||
const top = parseInt(regionElement.style.top.slice(0, -1), 10) || 0; | ||
const left = parseInt(regionElement.style.left.slice(0, -1), 10) || 0; | ||
const height = parseInt(regionElement.style.height.slice(0, -1), 10) || 0; | ||
const width = parseInt(regionElement.style.width.slice(0, -1), 10) || 0; | ||
const realTop = Math.max(0, Math.min(100 - height, top)); | ||
const realLeft = Math.max(0, Math.min(100 - width, left)); | ||
regionElement.style.top = realTop + '%'; | ||
regionElement.style.left = realLeft + '%'; | ||
} | ||
@@ -511,0 +528,0 @@ regionElement.style.display = 'flex'; |
@@ -277,3 +277,32 @@ /*! @license | ||
/** | ||
* Parses an visual sample entry box. | ||
* @param {!shaka.util.DataViewReader} reader | ||
* @return {!shaka.util.ParsedVisualSampleEntryBox} | ||
*/ | ||
static visualSampleEntry(reader) { | ||
// Skip 6 reserved bytes. | ||
// Skip 2-byte data reference index. | ||
// Skip 16 more reserved bytes. | ||
reader.skip(24); | ||
// 4 bytes for width/height. | ||
const width = reader.readUint16(); | ||
const height = reader.readUint16(); | ||
// Skip 8 bytes for horizontal/vertical resolution. | ||
// Skip 4 more reserved bytes (0) | ||
// Skip 2-byte frame count. | ||
// Skip 32-byte compressor name (length byte, then name, then 0-padding). | ||
// Skip 2-byte depth. | ||
// Skip 2 more reserved bytes (0xff) | ||
reader.skip(50); | ||
return { | ||
width: width, | ||
height: height, | ||
}; | ||
} | ||
/** | ||
* Parses an audio sample entry box. | ||
@@ -872,2 +901,15 @@ * @param {!shaka.util.DataViewReader} reader | ||
* @typedef {{ | ||
* width: number, | ||
* height: number | ||
* }} | ||
* | ||
* @property {number} width | ||
* @property {number} height | ||
* | ||
* @exportDoc | ||
*/ | ||
shaka.util.ParsedVisualSampleEntryBox; | ||
/** | ||
* @typedef {{ | ||
* channelCount: number, | ||
@@ -874,0 +916,0 @@ * sampleRate: number |
@@ -730,11 +730,13 @@ /*! @license | ||
} else if (Platform.isXboxOne()) { | ||
const protectionCapabilities = | ||
new Windows.Media.Protection.ProtectionCapabilities(); | ||
const protectionResult = | ||
Windows.Media.Protection.ProtectionCapabilityResult; | ||
// isTypeSupported may return "maybe", which means the operation is not | ||
// completed. This means we need to retry | ||
// https://learn.microsoft.com/en-us/uwp/api/windows.media.protection.protectioncapabilityresult?view=winrt-22621 | ||
let result = null; | ||
maxResolution.width = 1920; | ||
maxResolution.height = 1080; | ||
try { | ||
const protectionCapabilities = | ||
new Windows.Media.Protection.ProtectionCapabilities(); | ||
const protectionResult = | ||
Windows.Media.Protection.ProtectionCapabilityResult; | ||
// isTypeSupported may return "maybe", which means the operation is not | ||
// completed. This means we need to retry | ||
// https://learn.microsoft.com/en-us/uwp/api/windows.media.protection.protectioncapabilityresult?view=winrt-22621 | ||
let result = null; | ||
const type = | ||
@@ -749,12 +751,10 @@ 'video/mp4;codecs="hvc1,mp4a";features="decode-res-x=3840,' + | ||
} while (result === protectionResult.maybe); | ||
if (result === protectionResult.probably) { | ||
maxResolution.width = 3840; | ||
maxResolution.height = 2160; | ||
} | ||
} catch (e) { | ||
result = protectionResult.notSupported; | ||
shaka.log.alwaysWarn('Xbox: Error detecting screen size, default ' + | ||
'screen size 1920x1080.'); | ||
} | ||
if (result === protectionResult.probably) { | ||
maxResolution.width = 3840; | ||
maxResolution.height = 2160; | ||
} else { | ||
maxResolution.width = 1920; | ||
maxResolution.height = 1080; | ||
} | ||
} else if (Platform.isWebOS()) { | ||
@@ -761,0 +761,0 @@ try { |
{ | ||
"name": "shaka-player", | ||
"description": "DASH/EME video player library", | ||
"version": "4.10.2", | ||
"version": "4.10.3", | ||
"homepage": "https://github.com/shaka-project/shaka-player", | ||
@@ -6,0 +6,0 @@ "author": "Google", |
@@ -399,11 +399,10 @@ /*! @license | ||
postRollAd = true; | ||
continue; | ||
} | ||
// Filter point within the seek range. For points with no endpoint | ||
// (client side ads) check that the start point is within range. | ||
if (point.start >= seekRange.start && point.start < seekRange.end) { | ||
if (point.end && point.end > seekRange.end) { | ||
continue; | ||
} | ||
const startDist = point.start - seekRange.start; | ||
if ((!point.end && point.start >= seekRange.start) || | ||
(typeof point.end == 'number' && point.end > seekRange.start)) { | ||
const startDist = | ||
Math.max(point.start, seekRange.start) - seekRange.start; | ||
const startFrac = (startDist / seekRangeSize) || 0; | ||
@@ -410,0 +409,0 @@ // For points with no endpoint assume a 1% length: not too much, |
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
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
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
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
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
19047268
433
175997