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

Expo/CLI Unable to load Dailymotion-Video-Player embedded script for Android in React Native #3391

Open
EduardSavchenko opened this issue Apr 10, 2024 · 2 comments

Comments

@EduardSavchenko
Copy link

Bug description:
Hello every one.
I have a problem with embedding dailymotion player (SDK) in web view, with issues reproduce in cli and expo build android.
In ios daily motion player work good.
Please help me with this problem, what I do wrong with this player

My Code :

View style={{paddingTop:20, width:"100%", height:500, borderWidth:1, borderColor:'red'}}>
<WebView
source={{ html: <!DOCTYPE html> <html> <head> <link rel="preload" href="{https://geo.dailymotion.com/libs/player.js" as="script"> <meta name="viewport" content="initial-scale=1"> <style>#player {pointer-events: none}</style> </head> <body> <script src="https://geo.dailymotion.com/libs/player.js"></script> <div id="my-dailymotion-player">My Player placeholder</div> <script> dailymotion .createPlayer("my-dailymotion-player", { video: "x84sh87", }) .then((player) => console.log(player)) .catch((e) => console.error(e)); </script> </body> </html> }}
autoManageStatusBarEnabled={true}
allowsInlineMediaPlayback
mediaPlaybackRequiresUserAction={false}
bounces={false}
scrollEnabled={false}
domStorageEnabled={true}
scalesPageToFit={false}
startInLoadingState={true}
showsHorizontalScrollIndicator={false}
showsVerticalScrollIndicator={false}
allowsFullscreenVideo={true}
javaScriptEnabled={true}
originWhitelist={["*"]}
/>

To Reproduce:
Only on Android Platform
In iOS work good

Expected behavior:
I expect the same work on two platforms iOS / Android

Screenshots/Videos:

Снимок экрана 2024-04-10 в 11 34 53

Environment:

  • OS: MacOS / Windows
  • OS version: Sonoma Version 14.4.1 / Windows 10-11
  • react-native version: react-native: 0.73.6
  • react-native-webview version: react-native-webview: 13.6.4
@EduardSavchenko
Copy link
Author

In Flipper have some massages

Снимок экрана 2024-04-15 в 12 02 46

@EduardSavchenko
Copy link
Author

Static HTML

Note that using static HTML requires the WebView property originWhiteList to ['*']. For some content, such as video embeds (e.g. Twitter or Facebook posts with video), the baseUrl needs to be set for the video playback to work

html (string) - A static HTML page to display in the WebView.
baseUrl (string) - The base URL to be used for any relative links in the HTML. This is also used for the origin header with CORS requests made from the WebView. See Android WebView Docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant