Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exitFullWindow() {
this.isFullWindow = false;
Events.off(document, 'keydown', this.fullWindowOnEscKey);
// Unhide scroll bars.
document.documentElement.style.overflow = this.docOrigOverflow;
// Remove fullscreen styles
Dom.removeElClass(document.body, 'vjs-full-window');
// Resize the box, controller, and poster to original sizes
// this.positionAll();
this.trigger('exitFullWindow');
}
;
if (!t.isVideo) {
return;
}
// Prevent container from attempting to stretch a second time
clearTimeout(t.containerSizeTimeout);
// come out of native fullscreen
if (Features.HAS_TRUE_NATIVE_FULLSCREEN && (Features.IS_FULLSCREEN || t.isFullScreen)) {
Features.cancelFullScreen();
}
// restore scroll bars to document
removeClass(document.documentElement, `${t.options.classPrefix}fullscreen`);
removeClass(t.getElement(t.container), `${t.options.classPrefix}container-fullscreen`);
if (t.options.setDimensions) {
t.getElement(t.container).style.width = `${t.normalWidth}px`;
t.getElement(t.container).style.height = `${t.normalHeight}px`;
if (isNative) {
t.node.style.width = `${t.normalWidth}px`;
t.node.style.height = `${t.normalHeight}px`;
} else {
const elements = t.getElement(t.container).querySelectorAll('embed, object, video'), total = elements.length;
for (let i = 0; i < total; i++) {
elements[i].style.width = `${t.normalWidth}px`;
elements[i].style.height = `${t.normalHeight}px`;
}
}
export function findPosition(el) {
let box = getBoundingClientRect(el);
if (!box) {
return {left: 0, top: 0};
}
const docEl = document.documentElement;
const body = document.body;
const clientLeft = docEl.clientLeft || body.clientLeft || 0;
const scrollLeft = window.pageXOffset || body.scrollLeft;
const left = box.left + scrollLeft - clientLeft;
const clientTop = docEl.clientLeft || body.clientLeft || 0;
const scrollTop = window.pageYOffset || body.scrollTop;
const top = box.top + scrollTop - clientTop;
// 安卓有时侯返回小数,稍微有点偏差,这里四舍五入下
return {
left: Math.round(left),
top: Math.round(top)
};
}
exitFullWindow() {
this.isFullWindow = false;
Events.off(document, 'keydown', this.fullWindowOnEscKey);
// Unhide scroll bars.
document.documentElement.style.overflow = this.docOrigOverflow;
// Remove fullscreen styles
Dom.removeElClass(document.body, 'vjs-full-window');
// Resize the box, controller, and poster to original sizes
// this.positionAll();
this.trigger('exitFullWindow');
}
function DOMDelegator() {
this.target = document.documentElement
this.events = {}
}
function DOMDelegator() {
this.target = document.documentElement
this.events = {}
}
export const SUPPORT_POINTER_EVENTS = (() => {
const
element = document.createElement('x'),
documentElement = document.documentElement,
getComputedStyle = window.getComputedStyle
;
if (!('pointerEvents' in element.style)) {
return false;
}
element.style.pointerEvents = 'auto';
element.style.pointerEvents = 'x';
documentElement.appendChild(element);
let supports = getComputedStyle && (getComputedStyle(element, '') || {}).pointerEvents === 'auto';
element.remove();
return !!supports;
})();
var getScrollData = function() {
var doc = document.documentElement;
return {
x: (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0),
y: (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0)
};
};
function getXY(event) {
var posx = 0
var posy = 0
if (!event) {
event = window.event
}
if (event.pageX || event.pageY) {
posx = event.pageX;
posy = event.pageY;
} else if (event.clientX || event.clientY) {
posx = event.clientX + document.body.scrollLeft +
document.documentElement.scrollLeft;
posy = event.clientY + document.body.scrollTop +
document.documentElement.scrollTop;
}
return new Point(posx, posy)
}
function beginObserve(observer) {
observer.observe(document.documentElement, {
childList: true,
subtree: true,
attributes: true,
attributeOldValue: true,
attributeFilter: [KEY_ATTR]
});
}