-
Notifications
You must be signed in to change notification settings - Fork 64
fix: Resolve infinite loading state in Safari with MSE and on-demand stream type #1257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
1aec18f
bf8406a
212ef5b
8caa8eb
92a886a
6cd269d
fb695c6
32f4d40
462a25b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -127,7 +127,7 @@ function getProps(el: MuxPlayerElement, state?: any): MuxTemplateProps { | |||||||
| playbackId: el.playbackId, | ||||||||
| hasSrc: !!el.playbackId || !!el.src || !!el.currentSrc, | ||||||||
| poster: el.poster, | ||||||||
| storyboard: el.storyboard, | ||||||||
| storyboard: el.hasLoaded && el.storyboard, | ||||||||
| storyboardSrc: el.getAttribute(PlayerAttributes.STORYBOARD_SRC), | ||||||||
| fullscreenElement: el.getAttribute(PlayerAttributes.FULLSCREEN_ELEMENT), | ||||||||
| placeholder: el.getAttribute('placeholder'), | ||||||||
|
|
@@ -285,10 +285,11 @@ const initialState = { | |||||||
| const DEFAULT_EXTRA_PLAYLIST_PARAMS = { redundant_streams: true }; | ||||||||
|
|
||||||||
| class MuxPlayerElement extends VideoApiElement implements IMuxPlayerElement { | ||||||||
| #defaultPlayerInitTime: number; | ||||||||
| #defaultPlayerInitTime: number | undefined; | ||||||||
| #isInit = false; | ||||||||
| #tokens: Tokens = {}; | ||||||||
| #userInactive = true; | ||||||||
| #hasLoaded = false; | ||||||||
|
||||||||
| #hasLoaded = false; |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| this.#hasLoaded = true; |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| get hasLoaded() { | |
| return this.#hasLoaded; | |
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -543,7 +543,6 @@ describe('<mux-player>', () => { | |
|
|
||
| const muxVideo = player.media; | ||
| const mediaPosterImage = player.mediaTheme.querySelector('media-poster-image'); | ||
| const storyboardTrack = muxVideo.shadowRoot.querySelector("track[label='thumbnails']"); | ||
|
|
||
| await waitUntil(() => !!muxVideo.getAttribute('src'), '<mux-video> src never set'); | ||
| assert.equal( | ||
|
|
@@ -557,7 +556,11 @@ describe('<mux-player>', () => { | |
| 'https://image.mux.com/bos2bPV3qbFgpVPaQ900Xd5UcdM6WXTmz02WZSz01nJ00tY/thumbnail.webp?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik96VU90ek1nUWhPbkk2MDJ6SlFQbU52THR4MDBnSjJqTlBxN0tTTzAxQlozelEifQ.eyJleHAiOjE5NjE2MDE3MzYsImF1ZCI6InQiLCJzdWIiOiJib3MyYlBWM3FiRmdwVlBhUTkwMFhkNVVjZE02V1hUbXowMldaU3owMW5KMDB0WSJ9.gDe_efqmRB5E3e4ag6in8MfMK-Vn3c_3B4M-BiWw6lg2aaf2BOTv7ltxhn2cvg4G0iFi-esRjhDlHbMRTxwTGavsx8TRLFtJ8vyBzToaFQbQMrn9OZztq_XrCEwqkD8bUAVtdOT1YB606OZyy6XO-CxdMRrKMUsM-cGrfv0TxvzJjThJBY4SzFv_whtYRxqAypZojROU7IiTbqcsk_cSrRMjB7WyAOAvyPNKnr6RkVEuMJtlCtaf_e4DIJHebZUZb3JmVTG4jIWrD1QkN7uLUwCPPRvGhXwhet9JaJPyC5lmkcb9YmH-15V6GOpwSg7sDMGC3YS4aIb_RtVkan0t-w' | ||
| ); | ||
|
|
||
| await waitUntil(() => !!storyboardTrack.getAttribute('src'), 'storyboard <track> src never set'); | ||
| let storyboardTrack; | ||
| await waitUntil(() => { | ||
| storyboardTrack = muxVideo.shadowRoot.querySelector("track[label='thumbnails']"); | ||
| return storyboardTrack && !!storyboardTrack.getAttribute('src'); | ||
| }, 'storyboard <track> src never set'); | ||
|
Comment on lines
+559
to
+563
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @luwes this test was failing because |
||
| assert.equal( | ||
| storyboardTrack.getAttribute('src'), | ||
| 'https://image.mux.com/bos2bPV3qbFgpVPaQ900Xd5UcdM6WXTmz02WZSz01nJ00tY/storyboard.vtt?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik96VU90ek1nUWhPbkk2MDJ6SlFQbU52THR4MDBnSjJqTlBxN0tTTzAxQlozelEifQ.eyJleHAiOjE5NjE2MDE3NzcsImF1ZCI6InMiLCJzdWIiOiJib3MyYlBWM3FiRmdwVlBhUTkwMFhkNVVjZE02V1hUbXowMldaU3owMW5KMDB0WSJ9.aVd0dsOJUVeQko3BWd9YEhL41Eytf_ZfaBeNzHSSUqU_gREa_jJEVTlRfuiE4g71cKJLSiVTKP7f-F7Txh6DlL8E2SkonfIPB2H0f_3DQxYLso2E8qI4zuJkyxKORbQFLAEB_vSE-2lMbrHXfdpQhv6SrVyu6di9ku0LpFpoyz-_7fVJICr8nhlsqOGt66AYcaa99TXoZ582FWzBaePmWw-WWKYsLvtNjLS9UoxbdVaBRwNylohvhh-i1Y9dNilyNooJ7O8Cj4GuMjeh1pCj0BOrGagxrWrswm3HjUVNUqFq5JCWnJCxgjjwiV4RLZg_4z7gkBXyX7H2-i1dKA3Cpw&format=webp' | ||
|
|
@@ -771,6 +774,7 @@ describe('<mux-player>', () => { | |
| stream-type="on-demand" | ||
| muted | ||
| ></mux-player>`); | ||
|
|
||
| player.storyboardSrc = 'https://image.mux.com/VcmKA6aqzIzlg3MayLJDnbF55kX00mds028Z65QxvBYaA/storyboard.vtt'; | ||
| assert.equal( | ||
| player.storyboard, | ||
|
|
@@ -792,6 +796,7 @@ describe('<mux-player>', () => { | |
| stream-type="on-demand" | ||
| muted | ||
| ></mux-player>`); | ||
|
|
||
| const newStoryboardSrc = 'https://image.mux.com/VcmKA6aqzIzlg3MayLJDnbF55kX00mds028Z65QxvBYaA/storyboard.vtt'; | ||
| player.storyboardSrc = newStoryboardSrc; | ||
| assert.equal(player.storyboardSrc, newStoryboardSrc); | ||
|
|
@@ -806,6 +811,7 @@ describe('<mux-player>', () => { | |
| storyboard-token="eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik96VU90ek1nUWhPbkk2MDJ6SlFQbU52THR4MDBnSjJqTlBxN0tTTzAxQlozelEifQ.eyJleHAiOjE5NjE2MDE3NzcsImF1ZCI6InMiLCJzdWIiOiJib3MyYlBWM3FiRmdwVlBhUTkwMFhkNVVjZE02V1hUbXowMldaU3owMW5KMDB0WSJ9.aVd0dsOJUVeQko3BWd9YEhL41Eytf_ZfaBeNzHSSUqU_gREa_jJEVTlRfuiE4g71cKJLSiVTKP7f-F7Txh6DlL8E2SkonfIPB2H0f_3DQxYLso2E8qI4zuJkyxKORbQFLAEB_vSE-2lMbrHXfdpQhv6SrVyu6di9ku0LpFpoyz-_7fVJICr8nhlsqOGt66AYcaa99TXoZ582FWzBaePmWw-WWKYsLvtNjLS9UoxbdVaBRwNylohvhh-i1Y9dNilyNooJ7O8Cj4GuMjeh1pCj0BOrGagxrWrswm3HjUVNUqFq5JCWnJCxgjjwiV4RLZg_4z7gkBXyX7H2-i1dKA3Cpw" | ||
| storyboard-src="https://image.mux.com/VcmKA6aqzIzlg3MayLJDnbF55kX00mds028Z65QxvBYaA/storyboard.vtt" | ||
| ></mux-player>`); | ||
|
|
||
| assert.equal( | ||
| player.storyboard, | ||
| 'https://image.mux.com/bos2bPV3qbFgpVPaQ900Xd5UcdM6WXTmz02WZSz01nJ00tY/storyboard.vtt?token=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik96VU90ek1nUWhPbkk2MDJ6SlFQbU52THR4MDBnSjJqTlBxN0tTTzAxQlozelEifQ.eyJleHAiOjE5NjE2MDE3NzcsImF1ZCI6InMiLCJzdWIiOiJib3MyYlBWM3FiRmdwVlBhUTkwMFhkNVVjZE02V1hUbXowMldaU3owMW5KMDB0WSJ9.aVd0dsOJUVeQko3BWd9YEhL41Eytf_ZfaBeNzHSSUqU_gREa_jJEVTlRfuiE4g71cKJLSiVTKP7f-F7Txh6DlL8E2SkonfIPB2H0f_3DQxYLso2E8qI4zuJkyxKORbQFLAEB_vSE-2lMbrHXfdpQhv6SrVyu6di9ku0LpFpoyz-_7fVJICr8nhlsqOGt66AYcaa99TXoZ582FWzBaePmWw-WWKYsLvtNjLS9UoxbdVaBRwNylohvhh-i1Y9dNilyNooJ7O8Cj4GuMjeh1pCj0BOrGagxrWrswm3HjUVNUqFq5JCWnJCxgjjwiV4RLZg_4z7gkBXyX7H2-i1dKA3Cpw&format=webp' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix didn't work with
el.media.srcbut it does work withel.media?.currentSrc