Created
February 26, 2023 12:02
-
-
Save SummonHIM/8c558c5c20d78c54a192ec7746ebeaec to your computer and use it in GitHub Desktop.
网页 URL 播放器
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="zh"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>网页 URL 播放器</title> | |
| </head> | |
| <body> | |
| <video controls width="100%" height="100%" style="position: fixed;left: 0; top: 0;" id="player"> | |
| 你的浏览器不支持访问该网页! | |
| </video> | |
| <script> | |
| const queryString = window.location.search; | |
| const urlParams = new URLSearchParams(queryString); | |
| var videoUrl = urlParams.get("url"); | |
| if (videoUrl == undefined) { | |
| console.error("错误:键 'url' 不得为空") | |
| } else if (videoUrl == '') { | |
| console.error("错误:键 'url' 不得为空") | |
| } else { | |
| document.getElementById("player").src = videoUrl | |
| } | |
| </script> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html><html lang="zh"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>网页 URL 播放器</title></head><body><video controls width="100%" height="100%" style="position:fixed;left:0;top:0" id="player">你的浏览器不支持访问该网页!</video><script>const queryString=window.location.search;const urlParams=new URLSearchParams(queryString);var videoUrl=urlParams.get("url");if(videoUrl == undefined){console.error("错误:键 'url' 不得为空")}else if(videoUrl == ''){console.error("错误:键 'url' 不得为空")}else{document.getElementById("player").src = videoUrl}</script></body></html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment