momentum-design / momentum-ui

Momentum UI is a collection of UI libraries for implementing Momentum Design into web applications and websites.
https://momentum.design
MIT License
199 stars 204 forks source link

fix: enhance audio player error dispatching and teardown #1456

Closed zachraymer closed 1 year ago

zachraymer commented 1 year ago

The audio player will now stop audio when the component is destroyed and the audio player will not dispatch an error when the src is an empty string

Description

Error handling for audio src will ignore empty strings to avoid error dispatching when component is mounted but src has not yet been set. The component will also stop any playing audio when teardown occurs, due to no native way to destroy audio sources in browser.

Related Issue

Motivation and Context

How Has This Been Tested?

Screenshots:

Before (If applicable):

After:

Types of changes

Checklist:

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 63.63% and project coverage change: +0.10 :tada:

Comparison is base (8eda136) 94.03% compared to head (c4b507e) 94.14%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1456 +/- ## ========================================== + Coverage 94.03% 94.14% +0.10% ========================================== Files 134 134 Lines 18753 18765 +12 Branches 2863 2864 +1 ========================================== + Hits 17635 17666 +31 + Misses 1118 1099 -19 ``` | [Impacted Files](https://app.codecov.io/gh/momentum-design/momentum-ui/pull/1456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=momentum-design) | Coverage Δ | | |---|---|---| | [...ponents/src/components/audio-player/AudioPlayer.ts](https://app.codecov.io/gh/momentum-design/momentum-ui/pull/1456?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=momentum-design#diff-d2ViLWNvbXBvbmVudHMvc3JjL2NvbXBvbmVudHMvYXVkaW8tcGxheWVyL0F1ZGlvUGxheWVyLnRz) | `94.17% <63.63%> (-0.32%)` | :arrow_down: | ... and [8 files with indirect coverage changes](https://app.codecov.io/gh/momentum-design/momentum-ui/pull/1456/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=momentum-design)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

zachraymer commented 1 year ago

Did we decide not to the conditional tooltip that Pronoot requested?

Oops, just added back, was in the wrong changelist.