Web Player

Theater Mode Guide

Enable Player Theater Mode Guide

Enable Player Theater Mode Guide

The player can switch into “theater mode”, which enlarges it for a better viewing experience. Viewers toggle it with a button in the control bar.

In order for the player to have "theater" functionality you should:

  1. Create player with width and height parameters set to your desired aspect ratio (16:9, 4:3, 1:1, 2.35:1) or set width to 100%. This will enable the player to expand/shrink itself.
    Here's an example embed code of a player with theater mode enabled and proper sizes set:

    $bp("myDiv", {
    	"id":"PLAYER_ID",
    	"width":"16",
    	"height":"9",
    	"video":"VIDEO_ID",
    	"theaterMode":true
    });

    📘 Note

    Substitute your player and video ID in the above code.

  2. Put the player in the custom "div" element which will change its size when player enters/exits theater mode.
    Theater mode works by adding an empty CSS class bplr-theater-mode to the <body> HTML element of your page. It is up to you to define how the website responds to it. You should be able to define behavior of every single element of your website when entering the theater mode by simply defining a new CSS class for that element:

    body.bplr-theater-mode .your-element-class {
    	/* Add your custom styles here */
    }

And it will take effect when the "theater mode" button is pressed.

Controlling theater mode from JavaScript

Theater mode works only when "theaterMode": true is set in the embed code, and only when the player is on the page itself — inside an iframe it does nothing.

  • $bp('myDiv').toggleTheaterMode(true) enters theater mode; toggleTheaterMode(false) leaves it.

  • The theaterModeChange event fires on every change; e.data.on is true when entering and false when leaving.

  • "theaterModeClass" in the embed code changes the class added to <body> (default bplr-theater-mode).

  • To open the page in theater mode, add the class to <body> before the player loads.

$bp('myDiv').on('theaterModeChange', function (e) {
	console.log('Theater mode is ' + (e.data.on ? 'on' : 'off'));
});

For a fully working example, see the theater mode demo.

Theater Mode Guide · TargetVideo Developer Docs