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

Bug: React warning: maxResolution being passed to DOM Element #877

Open
1 task done
sabrichu opened this issue Feb 26, 2024 · 2 comments
Open
1 task done

Bug: React warning: maxResolution being passed to DOM Element #877

sabrichu opened this issue Feb 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@sabrichu
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Which Mux Elements/Packages does this apply to? Select all that apply

mux-video-react

Which browsers are you using?

Chrome

Which operating systems are you using?

macOS

Description

This is a similar bug to #602 in that Mux video props like maxResolution etc are being spread to the underlying <video> element, causing React warnings. Some props like streamType are being plucked out now before ...rest gets spread, but it's an incomplete list.

https://github.com/muxinc/elements/blob/main/packages/mux-video-react/src/index.tsx#L27

An ideal fix would stop all props meant to only be passed as Mux media props from being spread to <video> so that there aren't similar future issues filed.

Reduced test case

No response

Steps to reproduce

  1. Create a mux-video react component with maxResolution="1080p", e.g:
import MuxVideo from '@mux/mux-video-react';

const VideoPlayer = () => 
   <MuxVideo
        maxResolution="1080p"
        {...otherProps}
    />

Current Behavior

Warning logged in console

Expected Behavior

No warning logged

Errors

Screenshot 2024-02-25 at 8 36 07 PM

What version of the package are you using?

0.8.3

@sabrichu sabrichu added bug Something isn't working Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug labels Feb 26, 2024
@sabrichu sabrichu changed the title Bug: React warning: maxResolution being passed to a DOM Element Bug: React warning: maxResolution being passed to DOM Element Feb 26, 2024
@cjpillsbury
Copy link
Contributor

Thanks for filing the bug. We've added this feature to <mux-video> (web component), <mux-player> (web component), and <MuxPlayer> (react), but haaven't yet added it to <MuxVideo> (react). While these will be passed down to our "playback-core" and thus get applied "automagically", you're encountering some of the rough edges that result from not having official support just yet. As a stopgap, could you instead directly construct the src url, e.g.

src={`https:stream.mux.com/${playbackId}.m3u8?max_resolution=1080p`}

(See: https://docs.mux.com/guides/control-playback-resolution#specify-maximum-resolution for examples from the docs)

I'll also be sure to keep you posted/update this issue if/when we get a chance to tackle this in our priority queue.

@cjpillsbury cjpillsbury removed the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label Mar 7, 2024
@sabrichu
Copy link
Author

sabrichu commented Mar 7, 2024

Thanks for filing the bug. We've added this feature to <mux-video> (web component), <mux-player> (web component), and <MuxPlayer> (react), but haaven't yet added it to <MuxVideo> (react). While these will be passed down to our "playback-core" and thus get applied "automagically", you're encountering some of the rough edges that result from not having official support just yet. As a stopgap, could you instead directly construct the src url, e.g.

src={`https:stream.mux.com/${playbackId}.m3u8?max_resolution=1080p`}

(See: https://docs.mux.com/guides/control-playback-resolution#specify-maximum-resolution for examples from the docs)

I'll also be sure to keep you posted/update this issue if/when we get a chance to tackle this in our priority queue.

Sounds good, thank you for the workaround!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants