I'm implementing a mixed playlists (with Youtube and uploaded videos (using react-youtube
and Azure Media Player).
The desired features are:
- Swap between Youtube (Y) and Y videos.
- Swap between uploaded (U) and U videos.
- Swap between Y and U videos.
- Swap between U and Y videos.
- When Y video ends, auto play next video if Y.
- When U video ends, auto play next video if U.
- When Y video ends, auto play next video if U.
- When U video ends, auto play next video if Y.
The nonworking features are when swaping from Youtube to uploaded, all other options works perfectly. The error showed when trying to switch from Y to U is:
DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
I have a CourseDetails
component, in it, I use azuremediaplayer/mediaPlayer
component for U videos and react-youtube
. In both cases, I change the selected video with setState
, and I receive that error when doing that from a U video.
Edit 1: When changing from Y to Y or U video, the component doesn't unmount, neither when swaping between U videos. But when changing from U to Y it does. In both cases I'm changing the state.
Edit 2: The issue it's that the Azure Media Player component can't be removed. If I don't use that component the switching works (though not video is showed in U cases, so it's pointless).
Will gladly share any needed code for solving this.