Closed nwang92 closed 7 months ago
which video engine are you using?
if hls.js you have to either use https://github.com/muxinc/hls-video-element
or manually implement the renditions API https://github.com/muxinc/media-tracks https://github.com/muxinc/hls-video-element/blob/master/hls-video-element.js#L87-L200
Got it, thanks
@nwang92 what did you end up doing to implement the renditions menu? do you use hls-video-element with react?
@nwang92 what did you end up doing to implement the renditions menu? do you use hls-video-element with react?
I had some issues with using the hls-video-element
element in React as a drop-in solution so I didn't get very far there. I was thinking of reimplementing the renditions API myself but I haven't looked into it yet.
since recent there is a React wrapper for each of the custom media elements if that helps. https://media-elements-nextjs.vercel.app/hls-video https://github.com/muxinc/media-elements/blob/main/examples/nextjs/app/hls-video/page.tsx#L2
@nwang92 what did you end up doing to implement the renditions menu? do you use hls-video-element with react?
I had some issues with using the
hls-video-element
element in React as a drop-in solution so I didn't get very far there. I was thinking of reimplementing the renditions API myself but I haven't looked into it yet.
So I was able to get this working using @mux/mux-player-react but you have to use the playbackId from your src, but this way the renditions menu works
https://codesandbox.io/p/sandbox/youthful-mendel-forked-dwj5qt?file=%2Fsrc%2FPlayer.tsx
I didn't end up using the useEffect so I removed it, I tried passing the ref to MuxPlayer
like you did when you use <video>
, it plays the video but that didn't load the renditions menu either but it works when you use the playbackId
I have an example of the using hls.js with media-chrome in React and found that the renditions menu does not seem to populate with options other than "Auto".
I created an example here using this stream which should have multiple different size renditions: https://codesandbox.io/p/sandbox/youthful-mendel-tjqshd
It works when using a basic HTML example like shown in https://github.com/muxinc/media-chrome/discussions/845 but it doesn't seem to be working as expected with the React code. From inspecting elements, I see
mediarenditionunavailable="unsupported"
on the<media-controller>
element.Is there something I need to call to populate the menu or should it be automatic?