Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


    <script src=""></script>

    <video id="video-player" controls playsinline></video>


                video {
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
    position: fixed;

// The following SCSS block to hide the current time and
// seek/scrubber bar in Chrome for live streams. Safari hides
// these for a live stream by default. This does not work in Firefox
// since there does not appear to be a way to style the shadow DOM
// elements there.

video::-webkit-media-controls-current-time-display {
    display: none;



                (function (IVSPlayerPackage) {
    // First, check if the browser supports the IVS player.
    if (!IVSPlayerPackage.isPlayerSupported) {
        console.warn("The current browser does not support the IVS player.");

    const PlayerState = IVSPlayerPackage.PlayerState;
    const PlayerEventType = IVSPlayerPackage.PlayerEventType;

    // Initialize player
    const player = IVSPlayerPackage.create();
    console.log("IVS Player version:", player.getVersion());

    // Attach event listeners
    player.addEventListener(PlayerState.PLAYING, function () {
        console.log("Player State - PLAYING");
        console.log("Latency: " + player.getLiveLatency());
    player.addEventListener(PlayerState.ENDED, function () {
        console.log("Player State - ENDED");
    player.addEventListener(PlayerState.READY, function () {
        console.log("Player State - READY");
    player.addEventListener(PlayerEventType.ERROR, function (err) {
        console.warn("Player Event - ERROR:", err);
    player.addEventListener(PlayerEventType.TEXT_METADATA_CUE, (cue) => {
        const metadataText = cue.text;
        const position = player.getPosition().toFixed(2);
            `PlayerEvent - TEXT_METADATA_CUE: "${metadataText}". Observed ${position}s after playback started.`

    player.addEventListener(PlayerState.BUFFERING, function () {
        console.log("Player State - BUFFERING");

    player.addEventListener(PlayerEventType.REBUFFERING, function () {
        console.log("Player State - REBUFFERING");
        rebuffered = true;

    // Setup stream and play