Skip to content

Embed player

Sharkiller edited this page Jul 2, 2024 · 2 revisions

🔴 Embed the player in your web

You can embed the direct or IPTV player in your page using an iframe with src linking to the full extension player and the corresponding parameters.

🟢 Checking if the extension is installed

You can check if the extension is installed with javascript and show the iframe or ask to install the extension.

The follow script is an example in how you can check if the extension is installed or not.

function isInstalled(installed, uninstalled){
    let img = document.createElement('img');
    img.onerror = uninstalled;
    img.onload = installed;
    img.src = 'chrome-extension://opmeopcambhfimffbomjgemehjkbbmji/play-on.png'
}
isInstalled(
    // Installed
    () => {
        // Your code when detected extension is installed
        alert('installed');
    },
    // Uninstalled
    () => {
        // Your code when detected extension is uninstalled
        alert('uninstalled');
    }
);

Note: if the extension is disabled is detected as uninstalled.

🟢 Direct Player

You can generate a proper direct link using the "Clearkey Converter" in the extension settings.

<iframe allow="encrypted-media *; autoplay" src="chrome-extension://opmeopcambhfimffbomjgemehjkbbmji/pages/player.html#{LINK GENERATED WITH CLEARKEY CONVERTER}" width="1280" height="720"></iframe>

🔵 Example

<iframe allow="encrypted-media *; autoplay" src="chrome-extension://opmeopcambhfimffbomjgemehjkbbmji/pages/player.html#https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd" width="1280" height="720"></iframe>

🟢 IPTV Player

You can link to extension IPTV player with the m3u list at the end.

<iframe allow="encrypted-media *; autoplay" src="chrome-extension://opmeopcambhfimffbomjgemehjkbbmji/iptv/player.html#{LINK TO M3U LIST}" width="1280" height="720"></iframe>

🔵 Example

Here is an example with a list from: https://github.com/iptv-org/iptv

<iframe allow="encrypted-media *; autoplay" src="chrome-extension://opmeopcambhfimffbomjgemehjkbbmji/iptv/player.html#https://iptv-org.github.io/iptv/categories/animation.m3u" width="1280" height="720"></iframe>