Embedding Megaphone OneScreen on Your Website
Megaphone OneScreen is an interactive widget for displaying polls, quizzes, and titles in front of your own video player.
OneScreen can be embedded at a fixed width and height or with Automatic Layout-Mode Switching. When Automatic Layout-Mode Switching is enabled, Megaphone automatically switches between an Overlay mode suitable for lower-third graphics and Stacked mode, suitable for display in a tile below or beside a video player.
Figure 1. Automatic Layout-Mode Switching Enabled
To add Megaphone OneScreen to your website or app, follow the standard Megaphone embed process for either Home (used with Playlists) or MegaPages, as described in Megaphone Studio. To enable, Automatic Layout-Mode Switching, simply add ?presentation=stacked to the end of the URL you're embedding. Typical embed code is shown in the examples below.
<!DOCTYPE html> <html lang="en"> <head> <title>Megaphone OneScreen Example - Fixed Size</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style rel="stylesheet"> #player_container { position: relative; width: 70%; aspect-ratio: 16 / 9; } #video_iframe { width: 100%; height: 100%; } .megaphone-controller-iframe { position: absolute; width: calc(100% - 60px); min-height: 35%; max-height: 35%; bottom: 30px; left: 30px; border: none; } </style> </head> <body> <div id="player_container"> <iframe id="video_iframe" src="https://www.youtube.com/embed/9Auq9mYxFEE" allowfullscreen></iframe> <iframe class="megaphone-controller-iframe" src="https://guestonescreen.mega.page/fixed" loading="lazy" title="MegaController" allow="camera *;microphone *;fullscreen *;autoplay *; clipboard-write *;" allowfullscreen></iframe><script src="https://embed.megaphonetv.com/embed.js" data-name="megaphoneembed" type="text/javascript" defer></script> </div> </body> </html> |
<!DOCTYPE html> <html lang="en"> <head> <title>Megaphone OneScreen Example - Automatic Layout-Mode Switching</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <style rel="stylesheet"> #player_container { position: relative; width: 70%; aspect-ratio: 16 / 9; container-type: inline-size; container-name: player; } #video_iframe { width: 100%; height: 100%; } .megaphone-controller-iframe { position: absolute; width: calc(100% - 60px); min-height: 35%; max-height: 35%; bottom: 30px; left: 30px; border: none; } @container player (max-width: 725.5px) { #video_iframe { position: static; } .megaphone-controller-iframe { position: static; margin: 20px auto; max-height: revert; } } </style> </head> <body> <div id="player_container"> <iframe id="video_iframe" src="https://www.youtube.com/embed/9Auq9mYxFEE" allowfullscreen></iframe> <iframe class="megaphone-controller-iframe" src="https://guestonescreen.mega.page/layoutswitching?presentation=stacked" loading="lazy" title="MegaController" allow="camera *;microphone *;fullscreen *;autoplay *; clipboard-write *;" allowfullscreen></iframe><script src="https://embed.megaphonetv.com/embed.js" data-name="megaphoneembed" type="text/javascript" defer></script> </div> </body> </html> |