Skip to content

feat: retry logic for 412 not playable errors#1106

Merged
luwes merged 15 commits intomuxinc:mainfrom
Pintorado:retry-on-412-not-playable
Jun 18, 2025
Merged

feat: retry logic for 412 not playable errors#1106
luwes merged 15 commits intomuxinc:mainfrom
Pintorado:retry-on-412-not-playable

Conversation

@Pintorado
Copy link
Contributor

@Pintorado Pintorado commented Apr 28, 2025

Closes #531

This PR refactors how the player handles 412 (NETWORK_NOT_READY) errors.

Changes

Behavior:

  • Error dialog says “Live stream/video is not currently available. Retrying in [xx] seconds…” (different message depending if it's a live stream or VOD).
  • Retries after 5s the first time and then the retry time increases to 60s. It retries 5 more times with a 60s gap.
  • Stops retrying after 5 minutes and 5s and if there was no success on recovering the live stream/video, the UI shows "Live stream/video is not currently available. Try again later or click here to retry” with a retry link.

@vercel
Copy link

vercel bot commented Apr 28, 2025

@Pintorado is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

@snyk-io
Copy link

snyk-io bot commented Apr 28, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

@ronalduQualabs ronalduQualabs self-requested a review April 30, 2025 15:06
@Pintorado Pintorado marked this pull request as ready for review April 30, 2025 16:47
@Pintorado Pintorado requested a review from a team as a code owner April 30, 2025 16:47
@Pintorado Pintorado requested a review from luwes May 27, 2025 15:48
Comment on lines +1279 to +1281
} else {
hls.recoverMediaError();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this shouldn't be used here. recoverMediaError() is an attempt to recover a media decode error is my understanding or at least it's definitely not for a network error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right, I'll remove it

@Pintorado Pintorado requested a review from luwes June 5, 2025 18:06
@Pintorado Pintorado requested a review from luwes June 6, 2025 17:31
@vercel
Copy link

vercel bot commented Jun 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
elements-demo-astro ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 2:26pm
elements-demo-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 2:26pm
elements-demo-svelte-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 2:26pm
elements-demo-vanilla ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 2:26pm
elements-demo-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 16, 2025 2:26pm

Copy link
Contributor

@luwes luwes left a comment

Choose a reason for hiding this comment

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

LGTM

@luwes luwes merged commit 677c90a into muxinc:main Jun 18, 2025
11 checks passed
@github-actions github-actions bot mentioned this pull request Jun 18, 2025
luwes pushed a commit that referenced this pull request Jun 23, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>@mux/mux-audio: 0.15.10</summary>

##
[0.15.10](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.15.9...@mux/mux-audio@0.15.10)
(2025-06-23)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-audio-react: 0.15.10</summary>

##
[0.15.10](https://github.com/muxinc/elements/compare/@mux/mux-audio-react@0.15.9...@mux/mux-audio-react@0.15.10)
(2025-06-23)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/playback-core: 0.30.0</summary>

##
[0.30.0](https://github.com/muxinc/elements/compare/@mux/playback-core@0.29.1...@mux/playback-core@0.30.0)
(2025-06-23)


### Features

* add free plan logo
([#1140](#1140))
([a6b369e](a6b369e))
* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))
* retry logic for 412 not playable errors
([#1106](#1106))
([677c90a](677c90a))


### Bug Fixes

* **playback-core:** prefer uri value for chapters session metadata when
available. ([#1145](#1145))
([4dd2a50](4dd2a50))
* support URI and VALUE for session data
([#1146](#1146))
([930ad72](930ad72))
</details>

<details><summary>@mux/mux-player: 3.5.0</summary>

##
[3.5.0](https://github.com/muxinc/elements/compare/@mux/mux-player@3.4.1...@mux/mux-player@3.5.0)
(2025-06-23)


### Features

* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))
* retry logic for 412 not playable errors
([#1106](#1106))
([677c90a](677c90a))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/mux-video bumped from 0.25.3 to 0.26.0
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-player-react: 3.5.0</summary>

##
[3.5.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@3.4.1...@mux/mux-player-react@3.5.0)
(2025-06-23)


### Features

* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))


### Bug Fixes

* **mux-player-react news:** on demand ad tag url
([#1144](#1144))
([fbf1bb0](fbf1bb0))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/mux-player bumped from 3.4.1 to 3.5.0
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-video: 0.26.0</summary>

##
[0.26.0](https://github.com/muxinc/elements/compare/@mux/mux-video@0.25.3...@mux/mux-video@0.26.0)
(2025-06-23)


### Features

* add free plan logo
([#1140](#1140))
([a6b369e](a6b369e))
* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))


### Bug Fixes

* typeerror getLogoHTML of undefined
([35478ce](35478ce))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-video-react: 0.26.0</summary>

##
[0.26.0](https://github.com/muxinc/elements/compare/@mux/mux-video-react@0.25.3...@mux/mux-video-react@0.26.0)
(2025-06-23)


### Miscellaneous Chores

* **@mux/mux-video-react:** Synchronize video versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Jun 23, 2025
luwes pushed a commit that referenced this pull request Jun 23, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>@mux/mux-audio: 0.15.10</summary>

##
[0.15.10](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.15.9...@mux/mux-audio@0.15.10)
(2025-06-23)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-audio-react: 0.15.10</summary>

##
[0.15.10](https://github.com/muxinc/elements/compare/@mux/mux-audio-react@0.15.9...@mux/mux-audio-react@0.15.10)
(2025-06-23)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/playback-core: 0.30.0</summary>

##
[0.30.0](https://github.com/muxinc/elements/compare/@mux/playback-core@0.29.1...@mux/playback-core@0.30.0)
(2025-06-23)


### Features

* add free plan logo
([#1140](#1140))
([a6b369e](a6b369e))
* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))
* retry logic for 412 not playable errors
([#1106](#1106))
([677c90a](677c90a))


### Bug Fixes

* **playback-core:** prefer uri value for chapters session metadata when
available. ([#1145](#1145))
([4dd2a50](4dd2a50))
* support URI and VALUE for session data
([#1146](#1146))
([930ad72](930ad72))
</details>

<details><summary>@mux/mux-player: 3.5.0</summary>

##
[3.5.0](https://github.com/muxinc/elements/compare/@mux/mux-player@3.4.1...@mux/mux-player@3.5.0)
(2025-06-23)


### Features

* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))
* retry logic for 412 not playable errors
([#1106](#1106))
([677c90a](677c90a))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/mux-video bumped from 0.25.3 to 0.26.0
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-player-react: 3.5.0</summary>

##
[3.5.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@3.4.1...@mux/mux-player-react@3.5.0)
(2025-06-23)


### Features

* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))


### Bug Fixes

* **mux-player-react news:** on demand ad tag url
([#1144](#1144))
([fbf1bb0](fbf1bb0))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/mux-player bumped from 3.4.1 to 3.5.0
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-video: 0.26.0</summary>

##
[0.26.0](https://github.com/muxinc/elements/compare/@mux/mux-video@0.25.3...@mux/mux-video@0.26.0)
(2025-06-23)


### Features

* add free plan logo
([#1140](#1140))
([a6b369e](a6b369e))
* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))


### Bug Fixes

* typeerror getLogoHTML of undefined
([35478ce](35478ce))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-video-react: 0.26.0</summary>

##
[0.26.0](https://github.com/muxinc/elements/compare/@mux/mux-video-react@0.25.3...@mux/mux-video-react@0.26.0)
(2025-06-23)


### Miscellaneous Chores

* **@mux/mux-video-react:** Synchronize video versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Jun 23, 2025
luwes pushed a commit that referenced this pull request Jun 24, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>@mux/mux-audio: 0.15.10</summary>

##
[0.15.10](https://github.com/muxinc/elements/compare/@mux/mux-audio@0.15.9...@mux/mux-audio@0.15.10)
(2025-06-23)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-audio-react: 0.15.10</summary>

##
[0.15.10](https://github.com/muxinc/elements/compare/@mux/mux-audio-react@0.15.9...@mux/mux-audio-react@0.15.10)
(2025-06-23)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/playback-core: 0.30.0</summary>

##
[0.30.0](https://github.com/muxinc/elements/compare/@mux/playback-core@0.29.1...@mux/playback-core@0.30.0)
(2025-06-23)


### Features

* add free plan logo
([#1140](#1140))
([a6b369e](a6b369e))
* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))
* retry logic for 412 not playable errors
([#1106](#1106))
([677c90a](677c90a))


### Bug Fixes

* **playback-core:** prefer uri value for chapters session metadata when
available. ([#1145](#1145))
([4dd2a50](4dd2a50))
* support URI and VALUE for session data
([#1146](#1146))
([930ad72](930ad72))
</details>

<details><summary>@mux/mux-player: 3.5.0</summary>

##
[3.5.0](https://github.com/muxinc/elements/compare/@mux/mux-player@3.4.1...@mux/mux-player@3.5.0)
(2025-06-23)


### Features

* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))
* retry logic for 412 not playable errors
([#1106](#1106))
([677c90a](677c90a))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/mux-video bumped from 0.25.3 to 0.26.0
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-player-react: 3.5.0</summary>

##
[3.5.0](https://github.com/muxinc/elements/compare/@mux/mux-player-react@3.4.1...@mux/mux-player-react@3.5.0)
(2025-06-23)


### Features

* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))


### Bug Fixes

* **mux-player-react news:** on demand ad tag url
([#1144](#1144))
([fbf1bb0](fbf1bb0))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/mux-player bumped from 3.4.1 to 3.5.0
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-video: 0.26.0</summary>

##
[0.26.0](https://github.com/muxinc/elements/compare/@mux/mux-video@0.25.3...@mux/mux-video@0.26.0)
(2025-06-23)


### Features

* add free plan logo
([#1140](#1140))
([a6b369e](a6b369e))
* Google IMA support for mux-player and mux-video variants
([#1128](#1128))
([ec31d4d](ec31d4d))


### Bug Fixes

* typeerror getLogoHTML of undefined
([35478ce](35478ce))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

<details><summary>@mux/mux-video-react: 0.26.0</summary>

##
[0.26.0](https://github.com/muxinc/elements/compare/@mux/mux-video-react@0.25.3...@mux/mux-video-react@0.26.0)
(2025-06-23)


### Miscellaneous Chores

* **@mux/mux-video-react:** Synchronize video versions


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @mux/playback-core bumped from 0.29.1 to 0.30.0
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot mentioned this pull request Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature request: mux-video should retry on 412 Not Playable

3 participants