<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>NOTFLIX TV</title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="monetag" content="67ef6c626d21e3ed237b05ffafd51ee5">
  	<!-- Cloudflare Web Analytics --><script defer src='https://static.cloudflareinsights.com/beacon.min.js' data-cf-beacon='{"token": "1e8dbeeba4114cf094dca5b9ebc69850"}'></script><!-- End Cloudflare Web Analytics -->
  <script disable-devtool-auto="" src="https://cdn.jsdelivr.net/npm/disable-devtool@latest"></script>
  <script src="//content.jwplatform.com/libraries/SAHhwvZq.js"></script>
  <script>document.addEventListener('contextmenu', function(event) {event.preventDefault();});</script>
  <link rel="stylesheet" href="//iptv-libre.pages.dev/style.css">
</head>
<body>
  <div id="wrapper">
    <div id="jwplayerDiv"></div>
    <div class="right-side">
      <div class="playlist-container">
        <ul id="playlistList"></ul>
      </div>
      <div class="iframe-container">
        <iframe src="https://player.13l.link/jQuery/jquery-ads.min.php" frameborder="0" scrolling="no" height="100%" width="100%"></iframe>
      </div>
    </div>
  </div>
  <script>
    fetch('https://player.13l.link/tv/the-helicopter-heist-2024.php')
  .then(response => response.json())
  .then(data => {
    const playlistList = document.getElementById('playlistList');
    data.forEach((channel, index) => {
      const listItem = document.createElement('LI');
      const link = document.createElement('A');
      link.href = '#';
      link.textContent = channel.name;
      link.onclick = () => playStream(channel, link);
      listItem.appendChild(link);
      playlistList.appendChild(listItem);
    });
    playStream(data[0], document.querySelectorAll('#playlistList a')[0]);
  })
  .catch(error => console.error('Error fetching channels:', error));

    function playStream(channel, element) {
  if (channel.type === 'embed') {
    const iframe = document.createElement('iframe');
    iframe.src = channel.file;
    iframe.frameBorder = 0;
    iframe.width = "100%";
    iframe.height = "100%";
    document.getElementById("jwplayerDiv").innerHTML = "";
    document.getElementById("jwplayerDiv").appendChild(iframe);
  } else if (channel.type === 'mp4') {
    const video = document.createElement('video');
    video.src = channel.file;
    video.controls = true;
    video.width = "100%";
    video.height = "100%";
    
    // Add subtitle support
    if (channel.subtitle) {
      const track = document.createElement('track');
      track.kind = 'subtitles';
      track.label = 'English';
      track.src = channel.subtitle;
      track.srclang = 'en';
      video.appendChild(track);
    }
    
    document.getElementById("jwplayerDiv").innerHTML = "";
    document.getElementById("jwplayerDiv").appendChild(video);
  } else {
    const playerSetup = {
      file: channel.file,
      autostart: true,
      stretching: "",
      width: "100%",
      type: channel.type || 'hls', 
      drm: channel.drm
    };
    if (channel.type === 'hls') {
      playerSetup.hlsjsConfig = {
        debug: false
      };
    }
    jwplayer("jwplayerDiv").setup(playerSetup);
  }
  document.querySelectorAll('#playlistList a').forEach(a => a.classList.remove('playing'));
  element.classList.add('playing');
}
  </script>
</body>
</html>