muxinc / elements

Custom elements for working with media in the browser that Just Work™
https://elements-demo-nextjs.vercel.app
MIT License
234 stars 45 forks source link

Feature Request: Drag and drop support #878

Open ralfcarneborn opened 5 months ago

ralfcarneborn commented 5 months ago

Is there an existing issue for this?

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

mux-player

Description

Please let me know if this does not belong here due to the problem existing elsewhere but the Mux Player (and if so, please help me understand why its occuring), but Im trying to create a page where i can drag and drop videos.

Im using Vue3 and have chose the SortableJS (sortablejs-vue3 & sortablejs) library, but i have tried lots of other libraries also with the same result.

When dragging a Mux Player video, it always resets to the beginning of the video after dropped. Here is a codesandbox of it: https://codesandbox.io/p/devbox/dragndrop-chdmjd

I commented out a version in the markup also where a normal video player is used and it works as expected.

Expected Behavior

I expect the to not restart the asset when its an on-demand, and i expect the live stream to continue at the same place. But it looks like its getting swapped out for a new instance when i complete the drop.

cjpillsbury commented 5 months ago

Hey @ralfcarneborn this is unfortunately a known issue with the current implementation. The tl;dr - we end up doing various cleanup tasks whenever the underlying web component(s) are removed from the DOM due to some garbage collection/memory management issues. We're hoping we can improve this "under the hood" so this is no longer necessary, but this will require a bit of non-trivial reworking of some of our core code. I'll be sure to let you know if/when we're able to prioritize this effort.