Full screen display, support PC/mobile, less than 1kb. 🚀Online demo
中文 | English
npm i -S be-full
import {beFull} from 'be-full';
beFull();
const el = document.getElementById('video');
beFull(el);
If there is a "black" gap (or other colors) when the element is full screen, the second parameter can be set to the specified color.
const el = document.getElementById("video");
beFull(el, "#fff");
Note: After executing "exitFull" or "toggleFull", the setting of ":fullscreen" will be automatically canceled.
exitFull();
The method of use is the same as beFull
, except that the second click will execute exitFull
toggleFull();
// Switch the specified element to full screen/exit
toggleFull(document.getElementById('video'));
isFull(document.getElementById('video')); // true or false