Open hellolgl opened 2 years ago
We are removing support for DOM.
Can you add support for react-native web instead of having React-native-dom as this library is not maintained now.
@hueniverse React Native Web is not React Native DOM. React Native Web is much more strongly supported and used, including by large orgs such as Twitter.
@Leena-Sharma-rsys Expo supports expo-av, which seems to have video support:
How is "we are removing support for DOM" a valid resolution for this issue?
The 5.2.0 version of this plugin is effectively broken and throws this "Unexpected token (55:7)" error without any clear or intuitive resolution. Please provide a viable workaround or reopen this issue so a fix can be prioritized.
@realchrisolin i agree, please provide a fix for this issue...
Bump! Should I downgrade or what?
At some point in the future I am going to want react-native-web support. I'm willing to work on that myself, but it is 100% a spare time thing so if anyone else needs support and can work on it straight away go ahead. I'll keep an eye on this issue and update if I make any progress.
To anyone seeing this issue, what is the fix in 2024?
Have some platform checks and load a different video player for the web?
To anyone seeing this issue, what is the fix in 2024?
Have some platform checks and load a different video player for the web?
Yep this is what my team had to do. Cleanest way is to create a Video.web.tsx
file and add your web-only logic there.
import {createElement} from 'react-native-web';
export default function Video({src, height, width}) {
const attrs = {
src,
height,
width,
controls: true,
autoPlay: false,
...
};
return createElement('video', attrs);
}
@joshlbaker if you can open a pull request for that, it wouild be wonderfull !
I wrote a video.web component that is mostly a 1to1 mapping of rnv props, if there is interest I can upstream it, but it does not contain all features of rnv (no ads or drm support for example). I also need HLS and advanced subtitles support, so I use hls.js and some subtitle renderer in js. I think subtitles renderer don't need to be integrated here as long as a HTMLVideoElement ref is still available, but I think having hls built-in is good.
@zoriya you can contact me when you will have time and we can upstream this!
I'll probably have the time at the end of the month, early next month. I think I'll stick with a vanilla video player and let users handle hls/special media themselves.
Are there any updates?
There is PR for web support #3958 - I think I will have time to review and merge this soon
The PR to support react-native-web
is still open. When are you guys planning to merge the PR?
package.json
"react-native-video": "^5.2.0",