M / Clapperplayer /assets.js
LiveSportmm's picture
Update Clapperplayer/assets.js
405ea97 verified
player = new Clappr.Player({
source: "https://sportnext.online/hls/M1.m3u8",
type: "application/x-mpegURL",
mute:false,
height: 290,
width: "90%",
autostart: false,
poster: 'https://i.imgur.com/T4i6UFD.jpg',
parentId: "#clappr",
});
function castChannel(channelNumber) {
// Check if a player instance already exists, and if so, destroy it.
if (player) {
player.destroy();
}
// Create a new Clappr player instance.
player = new Clappr.Player({
source: "", // Leave this empty initially
type: "application/x-mpegURL",
mute: false,
height: 290,
width: "90%",
autostart: false,
poster: 'https://i.imgur.com/T4i6UFD.jpg',
parentId: "#clappr",
});
// Define video sources for each channel.
const videoSources = {
0: "https://sportnext.online/hls/M1.m3u8",
1: "https://sportnext.online/hls/M2.m3u8",
2: "https://sportnext.online/hls/M3.m3u8",
3: "https://sportnext.online/hls/M4.m3u8",
4: "https://sportnext.online/hls/M5.m3u8",
5: "https://nflarcadia.xyz/bRtT37sn3w/Sx5q6YTgCs/1.m3u8",
6: "https://nflarcadia.xyz/bRtT37sn3w/Sx5q6YTgCs/2.m3u8",
7: "https://nflarcadia.xyz/bRtT37sn3w/Sx5q6YTgCs/3.m3u8",
8: "https://nflarcadia.xyz/bRtT37sn3w/Sx5q6YTgCs/4.m3u8",
9: "https://nflarcadia.xyz/bRtT37sn3w/Sx5q6YTgCs/5.m3u8",
// Add more channels as needed
};
// Check if the channelNumber exists in the videoSources object.
if (videoSources.hasOwnProperty(channelNumber)) {
// Set the video source and unmute.
player.load(videoSources[channelNumber]);
// player.setVolume(0.5); // Unmute the player
} else {
console.error("Channel not found");
}
}
document.addEventListener('contextmenu', (e) => e.preventDefault());
function ctrlShiftKey(e, keyCode) {
return e.ctrlKey && e.shiftKey && e.keyCode === keyCode.charCodeAt(0);
}
document.onkeydown = (e) => {
// Disable F12, Ctrl + Shift + I, Ctrl + Shift + J, Ctrl + U
if (
event.keyCode === 123 ||
ctrlShiftKey(e, 'I') ||
ctrlShiftKey(e, 'J') ||
ctrlShiftKey(e, 'C') ||
(e.ctrlKey && e.keyCode === 'U'.charCodeAt(0))
)
return false;
};