Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
supportsFullScreen() {
if (typeof this.el_.webkitEnterFullScreen === 'function') {
const userAgent = window.navigator && window.navigator.userAgent || '';
// Seems to be broken in Chromium/Chrome && Safari in Leopard
if ((/Android/).test(userAgent) || !(/Chrome|Mac OS X 10.5/).test(userAgent)) {
return true;
}
}
return false;
}
if (!this.initialized_) {
return;
}
if (this.getVideoEl_().readyState === this.getVideoEl_().HAVE_ENOUGH_DATA) {
if (this.videoTexture) {
this.videoTexture.needsUpdate = true;
}
}
this.controls3d.update();
if (this.omniController) {
this.omniController.update(this.camera);
}
this.effect.render(this.scene, this.camera);
if (window.navigator.getGamepads) {
// Grab all gamepads
const gamepads = window.navigator.getGamepads();
for (let i = 0; i < gamepads.length; ++i) {
const gamepad = gamepads[i];
// Make sure gamepad is defined
// Only take input if state has changed since we checked last
if (!gamepad || !gamepad.timestamp || gamepad.timestamp === this.prevTimestamps_[i]) {
continue;
}
for (let j = 0; j < gamepad.buttons.length; ++j) {
if (gamepad.buttons[j].pressed) {
this.togglePlay_();
this.prevTimestamps_[i] = gamepad.timestamp;
break;
}
if (this.getVideoEl_().readyState === this.getVideoEl_().HAVE_ENOUGH_DATA) {
if (this.videoTexture) {
this.videoTexture.needsUpdate = true;
}
}
this.controls3d.update();
if (this.omniController) {
this.omniController.update(this.camera);
}
this.effect.render(this.scene, this.camera);
if (window.navigator.getGamepads) {
// Grab all gamepads
const gamepads = window.navigator.getGamepads();
for (let i = 0; i < gamepads.length; ++i) {
const gamepad = gamepads[i];
// Make sure gamepad is defined
// Only take input if state has changed since we checked last
if (!gamepad || !gamepad.timestamp || gamepad.timestamp === this.prevTimestamps_[i]) {
continue;
}
for (let j = 0; j < gamepad.buttons.length; ++j) {
if (gamepad.buttons[j].pressed) {
this.togglePlay_();
this.prevTimestamps_[i] = gamepad.timestamp;
break;
}
}
var sendGaEvent = function(image) {
const i = new window.Image();
const w = window;
const n = window.navigator;
const l = window.location;
const e = window.encodeURIComponent;
// Google Analytics has a limit of 10 million hits per month for free accounts.
// The Video.js CDN goes over this (by a lot) and they've asked us to stop.
if (Math.random() > 0.01) {
return;
}
// Setting the source of an image will load the URL even without adding to dom
// Using //www, still seems to work for https even though ssl.google is used by google
i.src='//www.google-analytics.com/__utm.gif'
// Version
+'?utmwv=5.4.2'
// ID
+'&utmac=UA-16505296-2'
/**
* @file global-options.js
*/
import document from 'global/document';
import window from 'global/window';
let navigator = window.navigator;
/*
* Global Player instance options, surfaced from Player.prototype.options_
* options = Player.prototype.options_
* All options should use string keys so they avoid
* renaming by closure compiler
*
* @type {Object}
*/
export default {
// Default order of fallback technology
'techOrder': ['html5','flash'],
// techOrder: ['flash','html5'],
'html5': {},
'flash': {},
* @file flash.js
* VideoJS-SWF - Custom Flash Player with HTML5-ish API
* https://github.com/zencoder/video-js-swf
* Not using setupTriggers. Using global onEvent func to distribute events
*/
import Tech from './tech';
import * as Dom from '../utils/dom.js';
import * as Url from '../utils/url.js';
import { createTimeRange } from '../utils/time-ranges.js';
import FlashRtmpDecorator from './flash-rtmp';
import Component from '../component';
import window from 'global/window';
import assign from 'object.assign';
let navigator = window.navigator;
/**
* Flash Media Controller - Wrapper for fallback SWF API
*
* @param {Object=} options Object of option names and values
* @param {Function=} ready Ready callback function
* @extends Tech
* @class Flash
*/
class Flash extends Tech {
constructor(options, ready){
super(options, ready);
// Set the source when ready
if (options.source) {
this.ready(function(){
it('should positively identify IE 11', function() {
window.navigator = {
userAgent: 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; .NET4.0E; .NET4.0C; rv:11.0) like Gecko'
};
expect(featureDetect.isIE()).to.be.true;
});
it('should positively identify IE Edge', function() {
/**
* @file browser.js
* @module browser
*/
import * as Dom from './dom';
import window from 'global/window';
const USER_AGENT = window.navigator && window.navigator.userAgent || '';
const webkitVersionMap = (/AppleWebKit\/([\d.]+)/i).exec(USER_AGENT);
const appleWebkitVersion = webkitVersionMap ? parseFloat(webkitVersionMap.pop()) : null;
/**
* Whether or not this device is an iPod.
*
* @static
* @const
* @type {Boolean}
*/
export const IS_IPOD = (/iPod/i).test(USER_AGENT);
/**
* The detected iOS version - or `null`.
*
* @static
* Not using setupTriggers. Using global onEvent func to distribute events
*/
import videojs from 'video.js';
import {version as SWF_VERSION} from 'videojs-swf/package.json';
import {version as VERSION} from '../package.json';
import FlashRtmpDecorator from './rtmp';
import window from 'global/window';
const Tech = videojs.getComponent('Tech');
const Dom = videojs.dom;
const Url = videojs.url;
const createTimeRange = videojs.createTimeRange;
const mergeOptions = videojs.mergeOptions;
const navigator = window && window.navigator || {};
/**
* Flash Media Controller - Wrapper for Flash Media API
*
* @mixes FlashRtmpDecorator
* @mixes Tech~SouceHandlerAdditions
* @extends Tech
*/
class Flash extends Tech {
/**
* Create an instance of this Tech.
*
* @param {Object} [options]
* The key/value store of player options.
*