-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
99 additions
and
3,296 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,9 @@ | |
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>BingeBuddies | Admin Controls</title> | ||
<title>BingeBud | Admin Controls</title> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"> | ||
<!-- <link href="https://vjs.zencdn.net/7.2.3/video-js.css" rel="stylesheet"> --> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
|
@@ -14,6 +15,8 @@ <h3>Theatre Controls</h3> | |
<div class="mb-3"> | ||
<label for="VideoURL" class="form-label">URL</label> | ||
<input type="text" class="form-control" id="VideoURL" placeholder="URL"> | ||
<button class="btn btn-primary btn-sm mt-2" id="dailymotionSource">Dailymotion</button> | ||
<button class="btn btn-primary btn-sm mt-2" id="previewSource">Preview</button> | ||
</div> | ||
<div class="mb-3"> | ||
<label for="VideoTitle" class="form-label">Title</label> | ||
|
@@ -59,6 +62,16 @@ <h3>Debug</h3> | |
|
||
<!-- <script src="../assets/js/script.js"></script> --> | ||
<script src="../bundle.js"></script> | ||
<script>document.getElementById('videoplayer').volume=0.01;</script> | ||
<script src="../assets/js/source.js"></script> | ||
<!-- <script src="https://vjs.zencdn.net/ie8/ie8-version/videojs-ie8.min.js"></script> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.14.1/videojs-contrib-hls.js"></script> | ||
<script src="https://vjs.zencdn.net/7.2.3/video.js"></script> --> | ||
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script> | ||
<script>document.getElementById('videoplayer').volume=0.01; | ||
var player = videojs('videoplayer'); | ||
</script> | ||
<script> | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
document.getElementById('dailymotionSource').addEventListener('click',()=>{ | ||
var dailymotionVideo = prompt('Enter Dailymotion URL'); | ||
var dailyID = dailymotionVideo.split('dailymotion.com/video/')[1] | ||
const dailymotionapi = "https://corsproxy.io/?https://www.dailymotion.com/player/metadata/video/<VIDEOID>?embedder=" | ||
getText(dailymotionapi.replace('<VIDEOID>',dailyID)); | ||
async function getText(file) { | ||
let x = await fetch(file); | ||
let y = await x.text(); | ||
let js = await JSON.parse(y); | ||
document.getElementById('VideoURL').value = js['qualities']['auto'][0]['url']; | ||
} | ||
}) | ||
|
||
|
||
function openVideoInNewTab(url) { | ||
// Create a new window for the video | ||
const newWindow = window.open("", "_blank"); | ||
|
||
// Create a video element in the new window | ||
const video = document.createElement("video"); | ||
video.src = url; | ||
video.controls = true; | ||
video.style.width = "100%"; | ||
video.style.height = "100%"; | ||
|
||
|
||
// Create a button to close the tab | ||
const closeButton = document.createElement("button"); | ||
closeButton.textContent = "Close Tab"; | ||
closeButton.onclick = () => { | ||
newWindow.close(); | ||
}; | ||
|
||
// Add the video and button to the new window's body | ||
newWindow.document.body.appendChild(video); | ||
newWindow.document.body.appendChild(closeButton); | ||
|
||
// Play the video automatically | ||
video.play(); | ||
} | ||
|
||
document.getElementById('previewSource').addEventListener('click',()=>{ | ||
openVideoInNewTab(document.getElementById('VideoURL').value); | ||
}) |
Oops, something went wrong.