Skip to content

Conversation

@peaBerberian
Copy link
Collaborator

Based on #1715

This commit shows an issue that can arise in the very rare scenario where:

  1. An application decides to load a content with no audio track (could be also with no video track).

  2. We fallback for some reason from all video tracks (or audio tracks if it's video that has been disabled in 1.) - in the test here this is due to the impossibility to fetch their licenses.

  3. We should here receive a noPlayableTrack event indicating that no video track is playable, allowing us to re-set our audio choice to still be able to play something BEFORE the NO_AUDIO_VIDEO_TRACKS error that arises when no video nor audio is selected.

    However we don't here, we receive directly a NO_AUDIO_VIDEO_TRACKS error and stop playback.

@peaBerberian peaBerberian added the work-in-progress This Pull Request or issue is not finished yet label Jul 21, 2025
@peaBerberian peaBerberian force-pushed the fix/no-playable-track-timeing branch from 036d1aa to 1618249 Compare July 21, 2025 15:32
… all the others' one

Based on #1715

This commit shows an issue that can arise in the very rare scenario
where:

1. An application decides to load a content with no audio track (could
   be also with no video track).

2. We fallback for some reason from all video tracks (or audio tracks
   if it's video that has been disabled in `1.`) - in the test here this
   is due to the impossibility to fetch their licenses.

3. We should here receive a `noPlayableTrack` event indicating that no
   video track is playable, allowing us to re-set our audio choice to
   still be able to play something **BEFORE** the `NO_AUDIO_VIDEO_TRACKS`
   error that arises when no video nor audio is selected.

   However we don't here, we receive directly a `NO_AUDIO_VIDEO_TRACKS`
   error and stop playback.
@peaBerberian peaBerberian force-pushed the fix/no-playable-track-timeing branch from 1618249 to 3e44237 Compare July 21, 2025 15:32
@github-actions
Copy link

✅ Automated performance checks have passed on commit 0389dc70de6cd2356240a644d248bf0fcd7e4098 with the base branch feat/disableAudioTrack.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 20.00ms -> 20.23ms (-0.230ms, z: 1.20585) 27.60ms -> 27.60ms
seeking 16.54ms -> 18.55ms (-2.011ms, z: 1.15159) 11.10ms -> 11.10ms
audio-track-reload 26.37ms -> 26.36ms (0.008ms, z: 0.58130) 38.55ms -> 38.55ms
cold loading multithread 46.59ms -> 45.89ms (0.696ms, z: 15.46242) 68.85ms -> 67.50ms
seeking multithread 49.83ms -> 45.80ms (4.036ms, z: 1.52173) 10.20ms -> 10.05ms
audio-track-reload multithread 26.19ms -> 26.22ms (-0.028ms, z: 0.20809) 38.55ms -> 38.55ms
hot loading multithread 15.27ms -> 15.24ms (0.025ms, z: 3.99934) 22.35ms -> 22.05ms

@github-actions
Copy link

✅ Automated performance checks have passed on commit ff88c719d1a6f51db4203fec74a8ae9e10029461 with the base branch feat/disableAudioTrack.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 19.95ms -> 20.05ms (-0.100ms, z: 1.05957) 27.45ms -> 27.45ms
seeking 14.54ms -> 18.52ms (-3.977ms, z: 0.35192) 10.95ms -> 10.95ms
audio-track-reload 26.12ms -> 26.15ms (-0.032ms, z: 0.18989) 38.10ms -> 38.10ms
cold loading multithread 46.28ms -> 45.55ms (0.730ms, z: 12.23267) 68.10ms -> 67.05ms
seeking multithread 37.73ms -> 33.73ms (3.995ms, z: 1.03790) 10.05ms -> 10.05ms
audio-track-reload multithread 25.99ms -> 25.91ms (0.083ms, z: 2.01490) 38.25ms -> 38.10ms
hot loading multithread 15.22ms -> 15.11ms (0.103ms, z: 2.89035) 21.90ms -> 21.75ms

@peaBerberian peaBerberian added the Priority: 1 (High) This issue or PR has a high priority. label Jul 23, 2025
@peaBerberian peaBerberian added this to the 4.4.0 milestone Jul 23, 2025
{ tracks: undefined },
);
noPlayableTrackToTrigger.push({
typeInfo.dispatcher?.updateTrack(storedSettings);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we're just after a trigger, shouldn't we:

  1. Check if it is disposed
  2. check hasStoredSettingsChanged (app could change the track on a trackUpdate for the reason "no-playable-representation" to choose its own fallback instead).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should still check that the previous trackUpdate did not lead to a track change no?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added that check

@github-actions
Copy link

✅ Automated performance checks have passed on commit e68e2ee483a907de7ad96e2922b05e7e2df7fff2 with the base branch feat/disableAudioTrack.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 20.66ms -> 20.71ms (-0.049ms, z: 0.37123) 28.35ms -> 28.35ms
seeking 17.20ms -> 26.57ms (-9.371ms, z: 1.01688) 11.10ms -> 11.10ms
audio-track-reload 26.59ms -> 26.66ms (-0.065ms, z: 0.32728) 38.70ms -> 38.70ms
cold loading multithread 47.34ms -> 46.42ms (0.913ms, z: 11.11467) 69.60ms -> 68.40ms
seeking multithread 32.48ms -> 33.84ms (-1.364ms, z: 0.23547) 10.20ms -> 10.20ms
audio-track-reload multithread 26.38ms -> 26.52ms (-0.137ms, z: 1.01539) 38.55ms -> 38.70ms
hot loading multithread 15.57ms -> 15.47ms (0.100ms, z: 3.00097) 22.50ms -> 22.35ms

@github-actions
Copy link

✅ Automated performance checks have passed on commit 5f9a812a074f296bd48f8f76a58eb3892e10cc35 with the base branch feat/disableAudioTrack.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 20.17ms -> 20.25ms (-0.077ms, z: 0.61766) 27.90ms -> 27.90ms
seeking 23.25ms -> 12.53ms (10.718ms, z: 0.89619) 11.10ms -> 11.10ms
audio-track-reload 26.60ms -> 26.56ms (0.040ms, z: 0.45061) 38.85ms -> 38.85ms
cold loading multithread 47.24ms -> 46.35ms (0.887ms, z: 10.97201) 69.90ms -> 68.40ms
seeking multithread 53.23ms -> 45.81ms (7.414ms, z: 0.35391) 10.05ms -> 10.20ms
audio-track-reload multithread 26.51ms -> 26.40ms (0.106ms, z: 1.14479) 38.85ms -> 38.85ms
hot loading multithread 16.07ms -> 15.92ms (0.156ms, z: 1.55950) 22.95ms -> 22.80ms

return;
}
if (trackType === "text") {
// we don't care for text fallback
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we care if it is the initial one no?

And shouldn't we care, by setting it to null, in the unlikely case of encrypted subtitles

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleMissingOrUnplayableTrack is never called with trackType "text" for initial selection, because we don't select text track by default, excepted if it has the "forceSubtitles" property.
But It's not done within this function.
Should I change anything ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this isn't something that's very clear from the scope of this function. I don't see why we would handle text as other types beside the NO_AUDIO_VIDEO thing from the current context. No? What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes you are right, it was not clear from this function's perspective, I have made an update

@github-actions
Copy link

✅ Automated performance checks have passed on commit 82f52273db38e229a2ef0ccafd0f362185793abb with the base branch feat/disableAudioTrack.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 18.97ms -> 19.35ms (-0.383ms, z: 2.45230) 26.10ms -> 26.25ms
seeking 16.34ms -> 17.07ms (-0.727ms, z: 0.26080) 10.80ms -> 10.80ms
audio-track-reload 25.61ms -> 25.60ms (0.009ms, z: 0.50626) 37.50ms -> 37.50ms
cold loading multithread 45.41ms -> 44.81ms (0.599ms, z: 14.85901) 67.05ms -> 65.85ms
seeking multithread 40.30ms -> 37.05ms (3.250ms, z: 1.83289) 9.90ms -> 10.05ms
audio-track-reload multithread 25.51ms -> 25.50ms (0.013ms, z: 1.10238) 37.65ms -> 37.50ms
hot loading multithread 14.61ms -> 14.54ms (0.073ms, z: 4.55035) 21.30ms -> 21.15ms

@github-actions
Copy link

✅ Automated performance checks have passed on commit 444868be3475344fd1276307d26f714d7be77fa4 with the base branch feat/disableAudioTrack.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 19.70ms -> 19.90ms (-0.203ms, z: 0.64651) 27.00ms -> 27.00ms
seeking 18.49ms -> 15.16ms (3.335ms, z: 0.65497) 10.95ms -> 10.95ms
audio-track-reload 26.01ms -> 25.97ms (0.036ms, z: 0.15006) 37.95ms -> 37.95ms
cold loading multithread 46.20ms -> 45.50ms (0.707ms, z: 14.72849) 68.25ms -> 67.05ms
seeking multithread 37.08ms -> 40.43ms (-3.349ms, z: 0.20815) 10.20ms -> 10.05ms
audio-track-reload multithread 25.96ms -> 25.99ms (-0.026ms, z: 0.68642) 38.25ms -> 38.25ms
hot loading multithread 15.06ms -> 14.80ms (0.266ms, z: 4.73139) 21.75ms -> 21.60ms

globals: false,
reporters: "dot",
include: [
// integration tests
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to remove that line

@github-actions
Copy link

✅ Automated performance checks have passed on commit faea428f8e03d84d2a8ba69173c8d9cb41a60eb1 with the base branch feat/disableAudioTrack.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 19.67ms -> 19.74ms (-0.071ms, z: 0.62310) 27.15ms -> 27.00ms
seeking 16.48ms -> 19.14ms (-2.663ms, z: 1.98195) 10.95ms -> 10.95ms
audio-track-reload 26.05ms -> 26.11ms (-0.053ms, z: 0.29938) 38.10ms -> 38.10ms
cold loading multithread 46.27ms -> 45.53ms (0.738ms, z: 14.68018) 68.25ms -> 67.05ms
seeking multithread 38.46ms -> 38.43ms (0.033ms, z: 0.92079) 10.20ms -> 10.05ms
audio-track-reload multithread 26.13ms -> 26.00ms (0.122ms, z: 0.67158) 38.40ms -> 38.25ms
hot loading multithread 15.02ms -> 14.96ms (0.058ms, z: 4.08821) 21.90ms -> 21.65ms

@peaBerberian peaBerberian merged commit 6683edb into feat/disableAudioTrack Jul 29, 2025
16 of 17 checks passed
@peaBerberian peaBerberian removed the work-in-progress This Pull Request or issue is not finished yet label Jul 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: 1 (High) This issue or PR has a high priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants