Skip to content

Conversation

@peaBerberian
Copy link
Collaborator

@peaBerberian peaBerberian commented Jul 21, 2025

We previously never added the disableAudioTrack API for two reasons:

  1. It's often much less needed than a disableTextTrack API and than a disableVideoTrack API (second one for "audio-only")

  2. It was unclear what behavior the RxPlayer should have if both audio and video were disabled

Since @Florent-Bouisset work on the new onAudioTracksNotPlayable / onVideoTracksNotPlayable options however, we do have a concrete way to deal with the absence of both audio and video: the noPlayableTrack event and NO_AUDIO_VIDEO_TRACKS error.

So now that there's no real barrier to add that API, I'm adding it.


This does not seem to really be needed right now by the different applications we work with, I just wanted to add that API now because it facilitates the writing of edge-cases-tests: I especially wanted to add a test for a pretty rare situation where there's no audio/video selected yet we're fallbacking from all of the other types' (video/audio) tracks due to DRM constraints.

I'm doing this now because now that advanced DRM integration tests are merged, we can begin to add tests for all those advanced edge cases scenarios to ensure we're keeping them under control.

@peaBerberian peaBerberian force-pushed the feat/disableAudioTrack branch 2 times, most recently from 43efc64 to 401158e Compare July 21, 2025 14:43
We previously never added the `disableAudioTrack` API for two reasons:

1. It's often much less needed than a `disableTextTrack` API and than a
   `disableVideoTrack` API (second one for "audio-only")

2. It was unclear what behavior the RxPlayer should have if both audio
   and video were disabled

Since @Florent-Bouisset work on the new `onAudioTracksNotPlayable` /
`onVideoTracksNotPlayable` options however, we do have a concrete way to
deal with the absence of both audio and video: the `noPlayableTrack`
`error` event.

So no that there's no real barrier to add that API, I'm adding it.

---

This does not seem to really be needed right now by the different
applications we work with, I just wanted to add that API now because it
facilitates the writing of edge-cases-tests: I especially wanted to add
a test for a pretty rare situation where there's no audio selected yet
we're fallbacking from all video tracks due to DRM constraints.

I'm doing this now because now that advanced DRM integration tests are
merged, we can begin to add tests for all those advanced edge cases
scenarios to ensure we're keeping them under control.
@peaBerberian peaBerberian force-pushed the feat/disableAudioTrack branch from 401158e to b430e37 Compare July 21, 2025 14:50
@github-actions
Copy link

✅ Automated performance checks have passed on commit 736788482da9eee50c94a9218334eea31db42ca6 with the base branch dev.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 21.05ms -> 21.23ms (-0.182ms, z: 0.84244) 29.10ms -> 29.10ms
seeking 17.36ms -> 25.45ms (-8.094ms, z: 1.68171) 11.25ms -> 11.25ms
audio-track-reload 27.34ms -> 27.31ms (0.027ms, z: 1.20128) 40.05ms -> 39.90ms
cold loading multithread 48.51ms -> 47.62ms (0.892ms, z: 13.56570) 71.70ms -> 70.35ms
seeking multithread 79.23ms -> 69.89ms (9.336ms, z: 0.16785) 10.20ms -> 10.20ms
audio-track-reload multithread 27.30ms -> 27.13ms (0.175ms, z: 1.40778) 40.05ms -> 40.05ms
hot loading multithread 17.04ms -> 16.97ms (0.068ms, z: 2.14059) 24.75ms -> 24.60ms

peaBerberian added a commit that referenced this pull request Jul 21, 2025
… 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 added a commit that referenced this pull request Jul 21, 2025
… 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 added a commit that referenced this pull request Jul 21, 2025
… 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 added the Priority: 2 (Medium) This issue or PR has a medium priority. label Jul 23, 2025
@peaBerberian peaBerberian added this to the 4.4.0 milestone Jul 23, 2025
… all the others' one (#1716)

* Allow application to reset an audio/video track when fallbacking from 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.

* fix: let a time window to switch track when receiving noPlayableTrack before sending an error

* simplify code

* remove debug setup

* fix: don't throw the trackUpdate event on initial track selection

* coden review

* code review 2

* re-add the comment

---------

Co-authored-by: Florent Bouisset <[email protected]>
@github-actions
Copy link

✅ Automated performance checks have passed on commit b18c5d87857376300cf19dad2ad6f3fb8c69caa0 with the base branch dev.

Details

Performance tests 1st run output

No significative change in performance for tests:

Name Mean Median
loading 19.68ms -> 19.81ms (-0.123ms, z: 0.77379) 27.15ms -> 27.15ms
seeking 15.14ms -> 18.50ms (-3.358ms, z: 0.21137) 11.10ms -> 10.95ms
audio-track-reload 26.09ms -> 26.04ms (0.052ms, z: 0.92077) 38.25ms -> 38.25ms
cold loading multithread 47.06ms -> 46.33ms (0.730ms, z: 13.53792) 68.40ms -> 67.35ms
seeking multithread 39.78ms -> 41.74ms (-1.962ms, z: 0.51421) 10.20ms -> 10.20ms
audio-track-reload multithread 25.84ms -> 25.87ms (-0.026ms, z: 0.88346) 37.95ms -> 38.10ms
hot loading multithread 15.15ms -> 15.07ms (0.082ms, z: 3.65625) 22.05ms -> 21.90ms

@peaBerberian peaBerberian merged commit 98018c6 into dev Jul 30, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: 2 (Medium) This issue or PR has a medium priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants