Skip to content

Commit 20c3473

Browse files
authored
Merge pull request #93 from bbc/configurable-playback-ended
Make PLAYBACK_ENDED event behaviour configurable in PlaybackController
2 parents 7c7e55f + f204daa commit 20c3473

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/core/Settings.js

+3
Original file line numberDiff line numberDiff line change
@@ -775,6 +775,8 @@ import Events from './events/Events';
775775
* Defines the delay in milliseconds between two consecutive checks for events to be fired.
776776
* @property {boolean} [seekWithoutReadyStateCheck=false]
777777
* This allows a seek by setting currentTime regardless of the loadedmetadata event being emitted
778+
* @property {boolean} [enableDashPlaybackEnded = false]
779+
* This enables the synthetic ended behaviour in PlaybackController that seeks and pauses the media element
778780
* @property {boolean} [parseInbandPrft=false]
779781
* Set to true if dash.js should parse inband prft boxes (ProducerReferenceTime) and trigger events.
780782
* @property {module:Settings~Metrics} metrics Metric settings
@@ -901,6 +903,7 @@ function Settings() {
901903
parseInbandPrft: false,
902904
enableManifestTimescaleMismatchFix: false,
903905
seekWithoutReadyStateCheck: false,
906+
enableDashPlaybackEnded: false,
904907
capabilities: {
905908
filterUnsupportedEssentialProperties: true,
906909
useMediaCapabilitiesApi: false

src/streaming/controllers/PlaybackController.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ function PlaybackController() {
699699

700700
// Handle DASH PLAYBACK_ENDED event
701701
function _onPlaybackEnded(e) {
702-
if (wallclockTimeIntervalId && e.isLast) {
702+
if (settings.get().streaming.enableDashPlaybackEnded && wallclockTimeIntervalId && e.isLast) {
703703
// PLAYBACK_ENDED was triggered elsewhere, react.
704704
logger.info('onPlaybackEnded -- PLAYBACK_ENDED but native video element didn\'t fire ended');
705705
const seekTime = e.seekTime ? e.seekTime : getStreamEndTime();

0 commit comments

Comments
 (0)