Skip to content

Commit

Permalink
Create script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Shineii86 authored Aug 8, 2024
1 parent 619de27 commit b08e46a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
function searchVideo() {
const videoUrl = document.getElementById('videoUrlInput').value;
if (videoUrl.trim() === "https://github.com/Shineii86/m3u8player/blob/main/resources/ShadowGarden.mp4") {
// Redirect to your Telegram account
window.location.href = 'https://telegram.me/Shineii86';
} else {
// Proceed with searching the video
const mergedUrl = 'https://shineii86.github.io/m3u8player/?video=' + encodeURIComponent(videoUrl);
window.location.href = mergedUrl;
}
}

const urlParams = new URLSearchParams(window.location.search);
const videoUrl = urlParams.get('video') || 'https://github.com/Shineii86/m3u8player/raw/main/resources/ShadowGarden.mp4';
const videoSource = document.getElementById('video-source');
videoSource.src = videoUrl;

fluidPlayer(
'my-video',
{
layoutControls: {
primaryColor: "rgba(224, 64, 251, 0.8)",
allowDownload: true
}
}
);

0 comments on commit b08e46a

Please sign in to comment.