• 🌙 Community Spirit

    Ramadan Mubarak! To honor this month, Crax has paused NSFW categories. Wishing you peace and growth!

SHAKA-PLAYER example (1 Viewer)

Currently reading:
 SHAKA-PLAYER example (1 Viewer)

Recently searched:

Iturpe

Member
LV
0
Joined
Jan 24, 2024
Threads
3
Likes
0
Awards
1
Credits
800©
Cash
0$
HTML:
<!DOCTYPE html>
<html>
<head>
  <title>TV</title>
  <style>
    #video-container {
      width: 100%;
      height: 0;
      padding-bottom: 56.25%; /* 16:9 aspect ratio (change as needed) */
      position: relative;
    }
    #video {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }
  </style>
</head>
<body>
  <div id="video-container">
    <video id="video" controls autoplay></video>
  </div>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.3.7/shaka-player.compiled.min.js"></script>
  <script>
    (async () => {
      try {
        await shaka.polyfill.installAll();
        if (!shaka.Player.isBrowserSupported()) {
          throw new Error('Browser not supported');
        }

        const video = document.getElementById('video');
        const player = new shaka.Player(video);

        const drmConfig = {
          clearKeys: {
            '0000000000000': '000000000000' // Replace with your ClearKey key ID and key
          }
        };

        await player.configure({
          drm: drmConfig
        });

        await player.load('http://.mpd');

        console.log('Video loaded successfully!');
      } catch (error) {
        console.error('Error loading video:', error);
      }
    })();
  </script>
</body>
</html>
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.

Tips
Recently searched:

Similar threads

Users who are viewing this thread

Top Bottom