Last active
August 15, 2025 12:00
-
-
Save ciacka/6a7aca2f0f2205ffc662fe5bb5592930 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| </head> | |
| <body> | |
| <div style="position: relative; width: 100%; padding-top: 56.25%;"> | |
| <iframe | |
| id="bunny-player" | |
| src="https://iframe.mediadelivery.net/embed/62372/bc979c06-698f-45f6-b923-81df31676e88?autoplay=true&preload=true&playsinline=true" | |
| allow="autoplay" | |
| style="position: absolute; top: 0; width: 100%; height: 100%; border: none;" | |
| ></iframe> | |
| </div> | |
| <script src="https://assets.mediadelivery.net/playerjs/playerjs-latest.min.js"></script> | |
| <script> | |
| const iframe = document.getElementById('bunny-player'); | |
| const player = new playerjs.Player(iframe); | |
| player.on('ready', function() { | |
| iframe.contentWindow.postMessage({ command: 'activate' }, '*'); | |
| window.addEventListener('message', function (e) { | |
| const { channel, event, status } = e.data; | |
| if (channel !== 'bunnystream') return; | |
| if (event === 'timeupdate') console.log('Current time:', status.currentTime); | |
| }) | |
| }); | |
| </script> | |
| </body> | |
| </html> |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| </head> | |
| <body> | |
| <div style="position: relative; width: 100%; padding-top: 56.25%;"> | |
| <iframe | |
| src="https://iframe.mediadelivery.net/embed/62372/bc979c06-698f-45f6-b923-81df31676e88" | |
| style="width: 100%; height: 100%; border: none; position: absolute; top: 0;" | |
| allow="autoplay" | |
| ></iframe> | |
| </div> | |
| <button type="button" id="play-btn">Play</button> | |
| <script src="https://code.jquery.com/jquery-3.7.1.min.js"></script> | |
| <script src="https://assets.mediadelivery.net/playerjs/playerjs-latest.min.js"></script> | |
| <script> | |
| (function($, document, window) { | |
| playerjs.DEBUG = true; | |
| var player = new playerjs.Player($('iframe')[0]); | |
| player.on('play', function() { | |
| console.log('Video started playing'); | |
| }); | |
| player.on('ready', function(data) { | |
| console.log('Player is ready'); | |
| }); | |
| $("#play-btn").on("click", function() { | |
| player.play(); | |
| }); | |
| })(jQuery, document, window); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment