UNPKG

react-native-webview-video

Version:

react-native-webview-video is a React Native library that provides a Video component that renders media content such as videos with custom controls for react-native and react-native-web. Support Youtube and Vimeo.

41 lines (37 loc) 1.33 kB
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Media player</title> <meta charset="utf-8"> <meta name="author" content="santran686@gmail.com"> <meta name="author" content="chainplatform.net"> <style> video, audio { display: none; width: 100%; } video { height: auto; } </style> </head> <body> <video id="videoplayer" controls controlsList="nodownload" oncontextmenu="return false;" style="display: none;"></video> <audio id="audioplayer" controls controlsList="nodownload" oncontextmenu="return false;" style="display: none;"></audio> <script> const parsedUrl = new URL(window.location.href), videoId = parsedUrl.searchParams.get("videoId"), videoType = parsedUrl.searchParams.get("videoType"); document.getElementById('audioplayer').style.display = "none"; document.getElementById('videoplayer').style.display = "none"; let mediaplayer = document.getElementById('audioplayer'); if (videoType == "video") { mediaplayer = document.getElementById('videoplayer'); } mediaplayer.src = `${videoId}`; mediaplayer.style.display = "block"; </script> </body> </html>