Skip to content
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

feat: use MC media-error-dialog #1014

Merged
merged 8 commits into from
Dec 6, 2024
Merged

Conversation

luwes
Copy link
Contributor

@luwes luwes commented Nov 15, 2024

related #1012
requires muxinc/media-chrome#1024

  • fixes an issue where the .error object could be null when the error event is dispatched.
    this was introduced when we started calling initialize() function deferred in mux-video I believe.
    this is fixed by saving the error state each time before we dispatch the error event.
  • the warning API is not implemented because after closer inspection we don't really do much with non-fatal errors.
    the only thing is doing a console.warn here:
    logger.warn(error);
    if (error.data) {
    logger.warn(`${error.name} data:`, error.data);
    }
    return;

    we can easily do that in playback-core if we want?

@luwes luwes self-assigned this Nov 15, 2024
Copy link

vercel bot commented Nov 15, 2024

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

A member of the Team first needs to authorize it.

@luwes luwes force-pushed the media-error-dialog branch from 1e1f24a to 55f7f40 Compare November 19, 2024 16:09
Copy link
Contributor

@cjpillsbury cjpillsbury left a comment

Choose a reason for hiding this comment

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

Some questions/callouts on the draft

packages/mux-player/src/index.ts Outdated Show resolved Hide resolved
packages/mux-player/src/index.ts Outdated Show resolved Hide resolved
packages/mux-player/src/index.ts Outdated Show resolved Hide resolved
packages/mux-player/src/index.ts Show resolved Hide resolved
Copy link

vercel bot commented Dec 4, 2024

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

Name Status Preview Comments Updated (UTC)
elements-demo-create-react-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 11:05pm
elements-demo-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 11:05pm
elements-demo-svelte-kit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 11:05pm
elements-demo-vanilla ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 11:05pm
elements-demo-vue ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 5, 2024 11:05pm

@@ -18,7 +18,7 @@
"esModuleInterop": true,
"skipLibCheck": false,
"forceConsistentCasingInFileNames": true,
"typeRoots": ["node_modules/@types", "../../types/media-chrome.d.ts"]
Copy link
Contributor

Choose a reason for hiding this comment

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

question(blocking): Why were these types things changed for this PR? This might be right (I'd want to make sure for all the different use cases we have), but unless this is needed for the PR, these changes should be backed out and added to a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was needed to make it build, because the MediaErrorDialog class is imported.

the media-chrome.d.ts file was excluding the types that are now available in the Media Chrome pkg itself

declare module 'media-chrome' {
  export class MediaTheme extends HTMLElement {}
  export class MediaController extends HTMLElement {
    media: HTMLVideoElement;
  }
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Since I wasn't anticipating reviewing this, as long as you're confident this isn't going to break any existing typescript consumers with any of the many setups we've had to fight against in the past, that's fine. Otherwise, there are less risky solutions to your immediate issue of building, albeit also less ideal overall. I'll defer to your judgment here.

Copy link
Contributor

@cjpillsbury cjpillsbury left a comment

Choose a reason for hiding this comment

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

some small callouts and looks like there are some linting errors, but this is def close.

@luwes luwes force-pushed the media-error-dialog branch from 233530f to 8ca8889 Compare December 5, 2024 22:35
@luwes
Copy link
Contributor Author

luwes commented Dec 6, 2024

Copy link
Contributor

@cjpillsbury cjpillsbury left a comment

Choose a reason for hiding this comment

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

Works for me. 👍

@luwes luwes merged commit 2fbb2c1 into muxinc:main Dec 6, 2024
9 of 11 checks passed
@luwes luwes deleted the media-error-dialog branch December 6, 2024 20:05
@github-actions github-actions bot mentioned this pull request Dec 10, 2024
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.

2 participants