Shaka Player Upgrade Guide
If you are upgrading from v1 or v2, these releases are no longer supported, and upgrade guides are no longer maintained. You can use these old upgrades guides to upgrade in stages:
Since v3.0, Shaka Player has been following semantic versioning. (The IE11 deprecation announced before v3.0 happened in v3.1, which technically breaks semantic versioning guarantees. It is the only intentional exception.)
Upgrading from any v3 release to a newer v3 release should be backward compatible. The same is true of all major version numbers (v4 => v4, etc).
Here is a summary of breaking changes that might require upgrades to your application:
v3.1
-
New dependencies:
- TextDecoder/TextEncoder platform support or polyfill required (affects Xbox One, but not evergreen browsers); we suggest the polyfill https://github.com/anonyco/FastestSmallestTextEncoderDecoder Fallback included by default in v4.2
-
Support removed:
- IE11 support removed
v4.0
-
Support removed:
- Older TVs and set-top boxes that do not support MediaSource sequence mode can no longer play HLS content (since we now use sequence mode for that)
- Support for iOS 12 and Safari 12 has been removed
-
Configuration changes:
manifest.dash.defaultPresentationDelayhas been replaced bymanifest.defaultPresentationDelay(deprecated in v3.0.0)- Configuration of factories should be plain factory functions, not
constructors; these will not be invoked with
new(deprecated in v3.1.0) drm.initDataTransformnow defaults to a no-opstreaming.smallGapLimitandstreaming.jumpLargeGapshave been removed; all gaps will now be jumpedmanifest.hls.useFullSegmentsForStartTimehas been removed; this setting is no longer necessary, as we no longer fetch segments for start times in the HLS parser
-
Player API changes:
shaka.Player.prototype.addTextTrack()has been replaced byaddTextTrackAsync(), which returns aPromise(deprecated in v3.1.0)
-
UI API changes:
shaka.ui.TrackLabelFormathas been renamed toshaka.ui.Overlay.TrackLabelFormat(deprecated in v3.1.0)shaka.ui.FailReasonCodehas been renamed toshaka.ui.Overlay.FailReasonCode(deprecated in v3.1.0)
-
Offline API changes:
shaka.offline.Storage.prototype.store()returnsAbortableOperationinstead ofPromise; callers should change.then()to.promise.then()andawait rvtoawait rv.promise(deprecated in v3.0.0)shaka.offline.Storage.prototype.getStoreInProgress()has been removed; concurrent operations are supported since v3, so callers don't need to check this (deprecated in v3.0.0)
-
Utility API changes:
shaka.util.Uint8ArrayUtils.equalhas been replaced byshaka.util.BufferUtils.equal, which can handle multiple types of buffers (deprecated in v3.0.0)
-
Manifest API changes:
shaka.media.SegmentIndex.prototype.destroy()has been replaced byrelease(), which is synchronous (deprecated in v3.0.0)shaka.media.SegmentIterator.prototype.seek(), which mutates the iterator, has been replaced byshaka.media.SegmentIndex.getIteratorForTime()(deprecated in v3.1.0)shaka.media.SegmentIndex.prototype.merge()has become private; usemergeAndEvict()instead (deprecated in v3.2.0)
-
Plugin changes:
AbrManagerplugins must implement theplaybackRateChanged()method (deprecated in v3.0.0)shaka.extern.Cue.prototype.spacerhas been replaced by the more clearly-namedlineBreak(deprecated in v3.1.0)IUIElementplugins must have arelease()method (notdestroy()) (deprecated in v3.0.0)
v5.0 (unreleased)
-
Configuration changes:
streaming.forceTransmuxTShas been renamed tostreaming.forceTransmux, and now also applies to AAC, MP3, AC-3, and EC-3 (deprecated in v4.3.0)manifest.dash.manifestPreprocessorandmanifest.mss.manifestPreprocessorhave been replaced withmanifest.dash.manifestPreprocessorTXmlandmanifest.mss.manifestPreprocessorTXmlcallbacks. These new callbacks now acceptshaka.externs.xml.Node.getAttribute()andtextContentresults must now be decoded if they might contain escape sequences. You can useshaka.util.StringUtils.htmlUnescapefor this purpose.streaming.useNativeHlsOnSafarihas removed. Now we have another config to do the same for FairPlaystreaming.useNativeHlsForFairPlayor for HLS (any browser)streaming.preferNativeHls.mediaSource.sourceBufferExtraFeatureshas been replaced withmediaSource.addExtraFeaturesToSourceBuffercallback.streaming.liveSyncMinLatencyandstreaming.liveSyncMaxLatencyhave been removed in favor ofstreaming.liveSync.targetLatency. (deprecated in v4.10.0)- The following options on
streaminghave been removed:liveSync,liveSyncTargetLatency,liveSyncTargetLatencyTolerance,liveSyncPlaybackRate,liveSyncMinPlaybackRate,liveSyncPanicModeliveSyncPanicThreshold.streaming.liveSyncis now an options object with the relevant options:enabled,targetLatency,targetLatencyTolerance,maxPlaybackRate,minPlaybackRate,panicModepanicThreshold. (deprecated in v4.10.0) useSafariBehaviorForLivehas been removed.parsePrftBoxhas been removed.videoRobustnessandaudioRobustnessare now only an array of strings. (deprecated in v4.13.0)streaming.forceHTTPhas been moved tonetworking.forceHTTP(deprecated in v4.15.0)streaming.forceHTTPShas been moved tonetworking.forceHTTPS(deprecated in v4.15.0)streaming.minBytesForProgressEventshas been moved tonetworking.minBytesForProgressEvents(deprecated in v4.15.0)manifest.dash.enableAudioGroupshas been moved tomanifest.enableAudioGroupspreferredVariantRolehas been renamed topreferredAudioRole(deprecated in v4.16.0)autoShowTexthas been removed.removeLatencyFromFirstPacketTimehas been removed.removeLatencyFromFirstPacketTimehas been removed.streaming.speechToTextmoved toaccessibility.speechToText
-
UI Configuration changes:
doubleClickForFullscreenis now enabled by default for mobile.preferDocumentPictureInPicturehas been renamed todocumentPictureInPicture.enabled.customContextMenuis now enabled by default for desktop browsers.addBigPlayButtonhas been removed; use thebigButtonsconfig instead.
-
Plugin changes:
TextDisplayerplugins must implement theconfigure()method.TextParserplugins must implement thesetManifestType()method.Transmuxerplugins now has three new parameters intransmux()method.- Removed
enableTextDisplayerfromTextDisplayerplugins
-
Player API Changes:
- The constructor no longer takes
mediaElementas a parameter; use theattachmethod to attach to a media element instead. (Deprecated in v4.6) - The
TimelineRegionInfo.eventElementhas been replaced withTimelineRegionInfo.eventNodeproperty, the new property type isshaka.externs.xml.Nodeinstead ofElement getAudioLanguagesandgetAudioLanguagesAndRoleshave been removed; instead, use the newgetAudioTracksAPI (Deprecated in v4.14)selectAudioLanguagehas been removed; instead, use the newselectAudioTrackAPI (Deprecated in v4.14)shaka.util.FairPlayUtilshas been moved toshaka.drm.FairPlay(Deprecated in v4.14)getChaptersis replaced bygetChaptersAsync(Deprecated in v4.15)- The
setTextTrackVisibilitymethod has been removed, along with the previous distinction between selecting a text track and toggling its visibility. Selecting a text track automatically makes it visible, there is no separate visibility control. - Apps must call
updateStartTimeinstead of setting the media element'scurrentTimedirectly during startup.
- The constructor no longer takes
-
Ad Manager API Changes:
- Added
setContainersto set the CS and SS containers. - Removed
videoandplayerparams on all methods. - Removed
initClientSide,initServerSide,initMediaTailorandinitInterstitial, since those things are now auto-initialized when necessary. onDashTimedMetadatahas been removed.
- Added
-
Initial track selection:
- With
autoShowTextremoved, the player now determines the initial text track exclusively usingpreferredTextLanguageandpreferredTextRole. - The app may choose not to pass preferences and instead rely on the tracks API (
getTextTracks,getAudioTracks) along with its own business logic.
- With
-
Error API changes:
MEDIA_SOURCE_OPERATION_THREWerror now includes object with details from media element error inerror.data[1]or string with brief explanation.
-
UI:
airplaybutton has been removed; use theremotebutton instead