Lines Matching full:this
5 This file is part of VideoJS. Copyright 2010 Zencoder, Inc.
26 …this.JRClass = function(){}; JRClass.extend = function(prop) { var _super = this.prototype; initia…
37 this.video = document.getElementById(element);
39 this.video = element;
43 this.video.player = this;
44 this.values = {}; // Cache video values.
45 this.elements = {}; // Store refs to controls elements.
48 this.options = {
61 if (typeof VideoJS.options == "object") { _V_.merge(this.options, VideoJS.options); }
62 // Override default & global options with options specific to this player
63 if (typeof setOptions == "object") { _V_.merge(this.options, setOptions); }
65 …if (this.getPreloadAttribute() !== undefined) { this.options.preload = this.getPreloadAttribute();…
66 …if (this.getAutoplayAttribute() !== undefined) { this.options.autoplay = this.getAutoplayAttribute…
69 this.box = this.video.parentNode;
70 this.linksFallback = this.getLinksFallback();
71 this.hideLinksFallback(); // Will be shown again if "links" player is used
77 this.each(this.options.playerFallbackOrder, function(playerType){
78 if (this[playerType+"Supported"]()) { // Check if player type is supported
79 this[playerType+"Init"](); // Initialize player type
85 this.activateElement(this, "player");
86 this.activateElement(this.box, "box");
92 this.behaviors[name] = activate;
93 this.extend(functions);
98 this.behaviors[behavior].call(this, element);
105 this.warnings.push(warning);
106 this.log(warning);
114 if (event.type) { this.history.push(event.type); }
115 if (this.history.length >= 50) { this.history.shift(); }
126 this.warning(VideoJS.warnings.localStorageFull);
133 if (typeof this.video.hasAttribute == "function" && this.video.hasAttribute("preload")) {
134 var preload = this.video.getAttribute("preload");
142 if (typeof this.video.hasAttribute == "function" && this.video.hasAttribute("autoplay")) {
143 var autoplay = this.video.getAttribute("autoplay");
149 …bufferedPercent: function(){ return (this.duration()) ? this.buffered()[1] / this.duration() : 0; …
155 if (fn.call(this, arr[i], i)) { break; }
160 if (obj.hasOwnProperty(attrname)) { this[attrname]=obj[attrname]; }
174 if (!this.flashElement) { this.flashElement = this.getFlashElement(); }
176 if (this.flashElement && this.flashPlayerVersionSupported()) {
183 this.replaceWithFlash();
184 this.element = this.flashElement;
185 this.video.src = ""; // Stop video from downloading if HTML5 is still supported
186 var flashPlayerType = VideoJS.flashPlayers[this.options.flashPlayer];
187 this.extend(VideoJS.flashPlayers[this.options.flashPlayer].api);
188 (flashPlayerType.init.context(this))();
192 var children = this.video.children;
201 // this.flashElement = this.video.removeChild(this.flashElement);
202 if (this.flashElement) {
203 this.box.insertBefore(this.flashElement, this.video);
204 this.video.style.display = "none"; // Removing it was breaking later players
207 // Check if browser can use this flash player
209 …var playerVersion = (this.options.flashPlayerVersion) ? this.options.flashPlayerVersion : VideoJS.…
220 this.element.width = width;
221 this.box.style.width = width+"px";
222 this.triggerResizeListeners();
223 return this;
225 return this.element.width;
229 this.element.height = height;
230 this.box.style.height = height+"px";
231 this.triggerResizeListeners();
232 return this;
234 return this.element.height;
245 this.showLinksFallback();
246 this.element = this.video;
249 getLinksFallback: function(){ return this.box.getElementsByTagName("P")[0]; },
252 if (this.linksFallback) { this.linksFallback.style.display = "none"; }
256 if (this.linksFallback) { this.linksFallback.style.display = "block"; }
272 VideoJS.extend = function(obj){ this.merge(this, obj, true); };
396 if (VideoJS.browserSupportsVideo() && this.canPlaySource()) {
403 this.element = this.video;
405 this.fixPreloading(); // Support old browsers that used autobuffer
406 this.supportProgressEvents(); // Support browsers that don't use 'buffered'
409 this.volume((localStorage && localStorage.volume) || this.options.defaultVolume);
413 this.options.useBuiltInControls = true;
414 this.iOSInterface();
416 this.options.useBuiltInControls = true;
417 this.androidInterface();
421 if (!this.options.useBuiltInControls) {
422 this.video.controls = false;
424 if (this.options.controlsBelow) { _V_.addClass(this.box, "vjs-controls-below"); }
427 this.activateElement(this.video, "playToggle");
430 this.buildStylesCheckDiv(); // Used to check if style are loaded
431 this.buildAndActivatePoster();
432 this.buildBigPlayButton();
433 this.buildAndActivateSpinner();
434 this.buildAndActivateControlBar();
435 this.loadInterface(); // Show everything once styles are loaded
436 this.getSubtitles();
443 if (this.canPlaySourceResult) { return this.canPlaySourceResult; }
445 var children = this.video.children;
448 var canPlay = this.video.canPlayType(children[i].type) || this.canPlayExt(children[i].src);
450 this.firstPlayableSource = children[i];
451 this.canPlaySourceResult = true;
456 this.canPlaySourceResult = false;
478 this.video.src = this.firstPlayableSource.src; // From canPlaySource()
479 this.video.load();
485 …if (typeof this.video.hasAttribute == "function" && this.video.hasAttribute("preload") && this.vid…
486 this.video.autobuffer = true; // Was a boolean
488 this.video.autobuffer = false;
489 this.video.preload = "none";
496 _V_.addListener(this.video, 'progress', this.playerOnVideoProgress.context(this));
499 this.setBufferedFromProgress(event);
503 var newBufferEnd = (event.loaded / event.total) * this.duration();
504 if (newBufferEnd > this.values.bufferEnd) { this.values.bufferEnd = newBufferEnd; }
509 if(VideoJS.iOSVersion() < 4) { this.forceTheSource(); } // Fix loading issues
511 … this.buildAndActivateSpinner(); // Spinner still works well on iPad, since iPad doesn't have one
518 this.forceTheSource(); // Fix loading issues
519 _V_.addListener(this.video, "click", function(){ this.play(); }); // Required to play
520 …this.buildBigPlayButton(); // But don't activate the normal way. Pause doesn't work right on andro…
521 _V_.addListener(this.bigPlayButton, "click", function(){ this.play(); }.context(this));
522 this.positionBox();
523 this.showBigPlayButtons();
528 if(!this.stylesHaveLoaded()) {
530 if (!this.positionRetries) { this.positionRetries = 1; }
531 if (this.positionRetries++ < 100) {
532 setTimeout(this.loadInterface.context(this),10);
536 this.hideStylesCheckDiv();
537 this.showPoster();
538 if (this.video.paused !== false) { this.showBigPlayButtons(); }
539 if (this.options.controlsAtStart) { this.showControlBars(); }
540 this.positionAll();
545 /* Creating this HTML
573 this.controls = _V_.createElement("div", { className: "vjs-controls" });
575 this.box.appendChild(this.controls);
576 this.activateElement(this.controls, "controlBar");
577 this.activateElement(this.controls, "mouseOverVideoReporter");
580 …this.playControl = _V_.createElement("div", { className: "vjs-play-control", innerHTML: "<span></s…
581 this.controls.appendChild(this.playControl);
582 this.activateElement(this.playControl, "playToggle");
585 this.progressControl = _V_.createElement("div", { className: "vjs-progress-control" });
586 this.controls.appendChild(this.progressControl);
589 this.progressHolder = _V_.createElement("div", { className: "vjs-progress-holder" });
590 this.progressControl.appendChild(this.progressHolder);
591 this.activateElement(this.progressHolder, "currentTimeScrubber");
594 this.loadProgressBar = _V_.createElement("div", { className: "vjs-load-progress" });
595 this.progressHolder.appendChild(this.loadProgressBar);
596 this.activateElement(this.loadProgressBar, "loadProgressBar");
599 this.playProgressBar = _V_.createElement("div", { className: "vjs-play-progress" });
600 this.progressHolder.appendChild(this.playProgressBar);
601 this.activateElement(this.playProgressBar, "playProgressBar");
604 this.timeControl = _V_.createElement("div", { className: "vjs-time-control" });
605 this.controls.appendChild(this.timeControl);
608 …this.currentTimeDisplay = _V_.createElement("span", { className: "vjs-current-time-display", inner…
609 this.timeControl.appendChild(this.currentTimeDisplay);
610 this.activateElement(this.currentTimeDisplay, "currentTimeDisplay");
613 this.timeSeparator = _V_.createElement("span", { innerHTML: " / " });
614 this.timeControl.appendChild(this.timeSeparator);
617 …this.durationDisplay = _V_.createElement("span", { className: "vjs-duration-display", innerHTML: "…
618 this.timeControl.appendChild(this.durationDisplay);
619 this.activateElement(this.durationDisplay, "durationDisplay");
622 this.volumeControl = _V_.createElement("div", {
626 this.controls.appendChild(this.volumeControl);
627 this.activateElement(this.volumeControl, "volumeScrubber");
629 this.volumeDisplay = this.volumeControl.children[0];
630 this.activateElement(this.volumeDisplay, "volumeDisplay");
633 this.fullscreenControl = _V_.createElement("div", {
637 this.controls.appendChild(this.fullscreenControl);
638 this.activateElement(this.fullscreenControl, "fullscreenToggle");
643 this.updatePosterSource();
644 if (this.video.poster) {
645 this.poster = document.createElement("img");
647 this.box.appendChild(this.poster);
650 this.poster.src = this.video.poster;
652 this.poster.className = "vjs-poster";
653 this.activateElement(this.poster, "poster");
655 this.poster = false;
661 /* Creating this HTML
664 this.bigPlayButton = _V_.createElement("div", {
668 this.box.appendChild(this.bigPlayButton);
669 this.activateElement(this.bigPlayButton, "bigPlayButton");
674 this.spinner = _V_.createElement("div", {
678 this.box.appendChild(this.spinner);
679 this.activateElement(this.spinner, "spinner");
685 // This causes a flicker where the controls are out of place.
687 this.stylesCheckDiv = _V_.createElement("div", { className: "vjs-styles-check" });
688 this.stylesCheckDiv.style.position = "absolute";
689 this.box.appendChild(this.stylesCheckDiv);
691 hideStylesCheckDiv: function(){ this.stylesCheckDiv.style.display = "none"; },
693 if (this.stylesCheckDiv.offsetHeight != 5) {
702 this.positionBox();
703 this.positionControlBars();
704 this.positionPoster();
708 if (this.videoIsFullScreen) {
709 this.box.style.width = "";
710 this.element.style.height="";
711 if (this.options.controlsBelow) {
712 this.box.style.height = "";
713 this.element.style.height = (this.box.offsetHeight - this.controls.offsetHeight) + "px";
716 this.box.style.width = this.width() + "px";
717 this.element.style.height=this.height()+"px";
718 if (this.options.controlsBelow) {
719 this.element.style.height = "";
720 // this.box.style.height = this.video.offsetHeight + this.controls.offsetHeight + "px";
727 var tracks = this.video.getElementsByTagName("TRACK");
730 this.subtitlesSource = tracks[i].getAttribute("src");
731 this.loadSubtitles();
732 this.buildSubtitles();
736 loadSubtitles: function() { _V_.get(this.subtitlesSource, this.parseSubtitles.context(this)); },
741 this.subtitles = [];
742 this.currentSubtitle = false;
743 this.lastSubtitleIndex = 0;
752 index: this.subtitles.length // Position in Array
758 subtitle.start = this.parseSubtitleTime(time[0]);
759 subtitle.end = this.parseSubtitleTime(time[1]);
770 // Add this subtitle
771 this.subtitles.push(subtitle);
793 /* Creating this HTML
796 this.subtitlesDisplay = _V_.createElement("div", { className: 'vjs-subtitles' });
797 this.box.appendChild(this.subtitlesDisplay);
798 this.activateElement(this.subtitlesDisplay, "subtitlesDisplay");
803 addVideoListener: function(type, fn){ _V_.addListener(this.video, type, fn.rEvtContext(this)); },
806 this.video.play();
807 return this;
809 onPlay: function(fn){ this.addVideoListener("play", fn); return this; },
812 this.video.pause();
813 return this;
815 onPause: function(fn){ this.addVideoListener("pause", fn); return this; },
816 paused: function() { return this.video.paused; },
820 try { this.video.currentTime = seconds; }
821 catch(e) { this.warning(VideoJS.warnings.videoNotReady); }
822 this.values.currentTime = seconds;
823 return this;
825 return this.video.currentTime;
828 this.currentTimeListeners.push(fn);
832 return this.video.duration;
837 if (this.values.bufferStart === undefined) {
838 this.values.bufferStart = 0;
839 this.values.bufferEnd = 0;
841 if (this.video.buffered && this.video.buffered.length > 0) {
842 var newEnd = this.video.buffered.end(0);
843 if (newEnd > this.values.bufferEnd) { this.values.bufferEnd = newEnd; }
845 return [this.values.bufferStart, this.values.bufferEnd];
851 this.values.volume = Math.max(0, Math.min(1, parseFloat(percentAsDecimal)));
852 this.video.volume = this.values.volume;
853 this.setLocalStorage("volume", this.values.volume);
854 return this;
856 if (this.values.volume) { return this.values.volume; }
857 return this.video.volume;
859 …onVolumeChange: function(fn){ _V_.addListener(this.video, 'volumechange', fn.rEvtContext(this)); },
863 this.video.width = width; // Not using style so it can be overridden on fullscreen.
864 this.box.style.width = width+"px";
865 this.triggerResizeListeners();
866 return this;
868 return this.video.offsetWidth;
872 this.video.height = height;
873 this.box.style.height = height+"px";
874 this.triggerResizeListeners();
875 return this;
877 return this.video.offsetHeight;
881 if(typeof this.video.webkitEnterFullScreen == 'function') {
892 this.video.webkitEnterFullScreen();
894 if (e.code == 11) { this.warning(VideoJS.warnings.videoNotReady); }
896 return this;
902 if (this.supportsFullScreen()) {
903 this.html5EnterNativeFullScreen();
905 this.enterFullWindow();
910 if (this.supportsFullScreen()) {
913 this.exitFullWindow();
918 this.videoIsFullScreen = true;
920 this.docOrigOverflow = document.documentElement.style.overflow;
922 _V_.addListener(document, "keydown", this.fullscreenOnEscKey.rEvtContext(this));
924 _V_.addListener(window, "resize", this.fullscreenOnWindowResize.rEvtContext(this));
928 _V_.addClass(this.box, "vjs-fullscreen");
930 this.positionAll();
935 this.videoIsFullScreen = false;
936 document.removeEventListener("keydown", this.fullscreenOnEscKey, false);
937 window.removeEventListener("resize", this.fullscreenOnWindowResize, false);
939 document.documentElement.style.overflow = this.docOrigOverflow;
941 _V_.removeClass(this.box, "vjs-fullscreen");
943 this.positionAll();
946 onError: function(fn){ this.addVideoListener("error", fn); return this; },
948 this.addVideoListener("ended", fn); return this;
960 this.onError(this.playerOnVideoError);
962 this.onPlay(this.playerOnVideoPlay);
963 this.onPlay(this.trackCurrentTime);
965 this.onPause(this.playerOnVideoPause);
966 this.onPause(this.stopTrackingCurrentTime);
968 this.onEnded(this.playerOnVideoEnded);
970 // this.trackCurrentTime();
971 this.trackBuffered();
973 this.onBufferedUpdate(this.isBufferFull);
976 this.log(event);
977 this.log(this.video.error);
979 playerOnVideoPlay: function(event){ this.hasPlayed = true; },
982 this.currentTime(0);
983 this.pause();
990 this.bufferedInterval = setInterval(this.triggerBufferedListeners.context(this), 500);
992 stopTrackingBuffered: function(){ clearInterval(this.bufferedInterval); },
995 this.bufferedListeners.push(fn);
998 this.isBufferFull();
999 this.each(this.bufferedListeners, function(listener){
1000 (listener.context(this))();
1004 if (this.bufferedPercent() == 1) { this.stopTrackingBuffered(); }
1009 if (this.currentTimeInterval) { clearInterval(this.currentTimeInterval); }
1010 …this.currentTimeInterval = setInterval(this.triggerCurrentTimeListeners.context(this), 100); // 42…
1011 this.trackingCurrentTime = true;
1015 clearInterval(this.currentTimeInterval);
1016 this.trackingCurrentTime = false;
1021 this.each(this.currentTimeListeners, function(listener){
1022 (listener.context(this))(newTime || this.currentTime());
1029 this.resizeListeners.push(fn);
1033 this.each(this.resizeListeners, function(listener){
1034 (listener.context(this))();
1043 _V_.addListener(element, "mousemove", this.mouseOverVideoReporterOnMouseMove.context(this));
1045 _V_.addListener(element, "mouseout", this.mouseOverVideoReporterOnMouseOut.context(this));
1048 this.showControlBars();
1049 clearInterval(this.mouseMoveTimeout);
1050 this.mouseMoveTimeout = setTimeout(this.hideControlBars.context(this), 4000);
1055 while (parent && parent !== this.box) {
1058 if (parent !== this.box) {
1059 this.hideControlBars();
1067 this.positionBox();
1069 this.activateElement(element, "mouseOverVideoReporter");
1070 this.onPlay(this.boxOnVideoPlay);
1071 this.onPause(this.boxOnVideoPause);
1074 _V_.removeClass(this.box, "vjs-paused");
1075 _V_.addClass(this.box, "vjs-playing");
1078 _V_.removeClass(this.box, "vjs-playing");
1079 _V_.addClass(this.box, "vjs-paused");
1086 this.activateElement(element, "mouseOverVideoReporter");
1087 this.activateElement(element, "playButton");
1088 this.onPlay(this.hidePoster);
1089 this.onEnded(this.showPoster);
1090 this.onResize(this.positionPoster);
1093 if (!this.poster) { return; }
1094 this.poster.style.display = "block";
1095 this.positionPoster();
1099 if (!this.poster || this.poster.style.display == 'none') { return; }
1100 this.poster.style.height = this.height() + "px"; // Need incase controlsBelow
1101 this.poster.style.width = this.width() + "px"; // Could probably do 100% of box
1104 if (!this.poster) { return; }
1105 this.poster.style.display = "none";
1108 // iPad breaks if you include a poster attribute, so this fixes that
1110 if (!this.video.poster) {
1111 var images = this.video.getElementsByTagName("img");
1112 if (images.length > 0) { this.video.poster = images[0].src; }
1120 if (!this.controlBars) {
1121 this.controlBars = [];
1122 this.onResize(this.positionControlBars);
1124 this.controlBars.push(element);
1125 _V_.addListener(element, "mousemove", this.onControlBarsMouseMove.context(this));
1126 _V_.addListener(element, "mouseout", this.onControlBarsMouseOut.context(this));
1129 if (!this.options.controlsAtStart && !this.hasPlayed) { return; }
1130 this.each(this.controlBars, function(bar){
1136 this.updatePlayProgressBars();
1137 this.updateLoadProgressBars();
1140 if (this.options.controlsHiding && !this.mouseIsOverControls) {
1141 this.each(this.controlBars, function(bar){
1147 onControlBarsMouseMove: function(){ this.mouseIsOverControls = true; },
1149 this.mouseIsOverControls = false;
1157 if (!this.elements.playToggles) {
1158 this.elements.playToggles = [];
1159 this.onPlay(this.playTogglesOnPlay);
1160 this.onPause(this.playTogglesOnPause);
1162 this.elements.playToggles.push(element);
1163 _V_.addListener(element, "click", this.onPlayToggleClick.context(this));
1166 if (this.paused()) {
1167 this.play();
1169 this.pause();
1173 this.each(this.elements.playToggles, function(toggle){
1179 this.each(this.elements.playToggles, function(toggle){
1188 _V_.addListener(element, "click", this.onPlayButtonClick.context(this));
1190 onPlayButtonClick: function(event){ this.play(); }
1195 _V_.addListener(element, "click", this.onPauseButtonClick.context(this));
1197 onPauseButtonClick: function(event){ this.pause(); }
1203 if (!this.playProgressBars) {
1204 this.playProgressBars = [];
1205 this.onCurrentTimeUpdate(this.updatePlayProgressBars);
1207 this.playProgressBars.push(element);
1211 …var progress = (newTime !== undefined) ? newTime / this.duration() : this.currentTime() / this.dur…
1213 this.each(this.playProgressBars, function(bar){
1222 if (!this.loadProgressBars) { this.loadProgressBars = []; }
1223 this.loadProgressBars.push(element);
1224 this.onBufferedUpdate(this.updateLoadProgressBars);
1227 this.each(this.loadProgressBars, function(bar){
1228 if (bar.style) { bar.style.width = _V_.round(this.bufferedPercent() * 100, 2) + "%"; }
1237 if (!this.currentTimeDisplays) {
1238 this.currentTimeDisplays = [];
1239 this.onCurrentTimeUpdate(this.updateCurrentTimeDisplays);
1241 this.currentTimeDisplays.push(element);
1245 if (!this.currentTimeDisplays) { return; }
1247 var time = (newTime) ? newTime : this.currentTime();
1248 this.each(this.currentTimeDisplays, function(dis){
1258 if (!this.durationDisplays) {
1259 this.durationDisplays = [];
1260 this.onCurrentTimeUpdate(this.updateDurationDisplays);
1262 this.durationDisplays.push(element);
1265 if (!this.durationDisplays) { return; }
1266 this.each(this.durationDisplays, function(dis){
1267 if (this.duration()) { dis.innerHTML = _V_.formatTime(this.duration()); }
1276 _V_.addListener(element, "mousedown", this.onCurrentTimeScrubberMouseDown.rEvtContext(this));
1281 this.currentScrubber = scrubber;
1283 this.stopTrackingCurrentTime(); // Allows for smooth scrubbing
1285 this.videoWasPlaying = !this.paused();
1286 this.pause();
1289 this.setCurrentTimeWithScrubber(event);
1290 _V_.addListener(document, "mousemove", this.onCurrentTimeScrubberMouseMove.rEvtContext(this));
1291 _V_.addListener(document, "mouseup", this.onCurrentTimeScrubberMouseUp.rEvtContext(this));
1294 this.setCurrentTimeWithScrubber(event);
1298 document.removeEventListener("mousemove", this.onCurrentTimeScrubberMouseMove, false);
1299 document.removeEventListener("mouseup", this.onCurrentTimeScrubberMouseUp, false);
1300 if (this.videoWasPlaying) {
1301 this.play();
1302 this.trackCurrentTime();
1306 var newProgress = _V_.getRelativePosition(event.pageX, this.currentScrubber);
1307 var newTime = newProgress * this.duration();
1308 this.triggerCurrentTimeListeners(0, newTime); // Allows for smooth scrubbing
1310 if (newTime == this.duration()) { newTime = newTime - 0.1; }
1311 this.currentTime(newTime);
1318 if (!this.volumeDisplays) {
1319 this.volumeDisplays = [];
1320 this.onVolumeChange(this.updateVolumeDisplays);
1322 this.volumeDisplays.push(element);
1323 this.updateVolumeDisplay(element); // Set the display to the initial volume
1328 if (!this.volumeDisplays) { return; }
1329 this.each(this.volumeDisplays, function(dis){
1330 this.updateVolumeDisplay(dis);
1334 var volNum = Math.ceil(this.volume() * 6);
1335 this.each(display.children, function(child, num){
1348 _V_.addListener(element, "mousedown", this.onVolumeScrubberMouseDown.rEvtContext(this));
1354 this.currentScrubber = scrubber;
1355 this.setVolumeWithScrubber(event);
1356 _V_.addListener(document, "mousemove", this.onVolumeScrubberMouseMove.rEvtContext(this));
1357 _V_.addListener(document, "mouseup", this.onVolumeScrubberMouseUp.rEvtContext(this));
1360 this.setVolumeWithScrubber(event);
1363 this.setVolumeWithScrubber(event);
1365 document.removeEventListener("mousemove", this.onVolumeScrubberMouseMove, false);
1366 document.removeEventListener("mouseup", this.onVolumeScrubberMouseUp, false);
1369 var newVol = _V_.getRelativePosition(event.pageX, this.currentScrubber);
1370 this.volume(newVol);
1377 _V_.addListener(element, "click", this.onFullscreenToggleClick.context(this));
1381 if (!this.videoIsFullScreen) {
1382 this.enterFullScreen();
1384 this.exitFullScreen();
1389 this.positionControlBars();
1394 this.exitFullScreen();
1402 if (!this.elements.bigPlayButtons) {
1403 this.elements.bigPlayButtons = [];
1404 this.onPlay(this.bigPlayButtonsOnPlay);
1405 this.onEnded(this.bigPlayButtonsOnEnded);
1407 this.elements.bigPlayButtons.push(element);
1408 this.activateElement(element, "playButton");
1410 bigPlayButtonsOnPlay: function(event){ this.hideBigPlayButtons(); },
1411 bigPlayButtonsOnEnded: function(event){ this.showBigPlayButtons(); },
1413 this.each(this.elements.bigPlayButtons, function(element){
1418 this.each(this.elements.bigPlayButtons, function(element){
1427 if (!this.spinners) {
1428 this.spinners = [];
1429 _V_.addListener(this.video, "loadeddata", this.spinnersOnVideoLoadedData.context(this));
1430 _V_.addListener(this.video, "loadstart", this.spinnersOnVideoLoadStart.context(this));
1431 _V_.addListener(this.video, "seeking", this.spinnersOnVideoSeeking.context(this));
1432 _V_.addListener(this.video, "seeked", this.spinnersOnVideoSeeked.context(this));
1433 _V_.addListener(this.video, "canplay", this.spinnersOnVideoCanPlay.context(this));
1434 … _V_.addListener(this.video, "canplaythrough", this.spinnersOnVideoCanPlayThrough.context(this));
1435 _V_.addListener(this.video, "waiting", this.spinnersOnVideoWaiting.context(this));
1436 _V_.addListener(this.video, "stalled", this.spinnersOnVideoStalled.context(this));
1437 _V_.addListener(this.video, "suspend", this.spinnersOnVideoSuspend.context(this));
1438 _V_.addListener(this.video, "playing", this.spinnersOnVideoPlaying.context(this));
1439 _V_.addListener(this.video, "timeupdate", this.spinnersOnVideoTimeUpdate.context(this));
1441 this.spinners.push(element);
1444 this.each(this.spinners, function(spinner){
1447 clearInterval(this.spinnerInterval);
1448 this.spinnerInterval = setInterval(this.rotateSpinners.context(this), 100);
1451 this.each(this.spinners, function(spinner){
1454 clearInterval(this.spinnerInterval);
1458 this.each(this.spinners, function(spinner){
1459 // spinner.style.transform = 'scale(0.5) rotate('+this.spinnersRotated+'deg)';
1460 spinner.style.WebkitTransform = 'scale(0.5) rotate('+this.spinnersRotated+'deg)';
1461 spinner.style.MozTransform = 'scale(0.5) rotate('+this.spinnersRotated+'deg)';
1463 if (this.spinnersRotated == 360) { this.spinnersRotated = 0; }
1464 this.spinnersRotated += 45;
1466 spinnersOnVideoLoadedData: function(event){ this.hideSpinners(); },
1467 spinnersOnVideoLoadStart: function(event){ this.showSpinners(); },
1468 spinnersOnVideoSeeking: function(event){ /* this.showSpinners(); */ },
1469 spinnersOnVideoSeeked: function(event){ /* this.hideSpinners(); */ },
1470 spinnersOnVideoCanPlay: function(event){ /* this.hideSpinners(); */ },
1471 spinnersOnVideoCanPlayThrough: function(event){ this.hideSpinners(); },
1475 this.showSpinners();
1479 spinnersOnVideoPlaying: function(event){ this.hideSpinners(); },
1482 if(this.spinner.style.display == "block") { this.hideSpinners(); }
1489 if (!this.subtitleDisplays) {
1490 this.subtitleDisplays = [];
1491 this.onCurrentTimeUpdate(this.subtitleDisplaysOnVideoTimeUpdate);
1492 this.onEnded(function() { this.lastSubtitleIndex = 0; }.context(this));
1494 this.subtitleDisplays.push(element);
1498 if (this.subtitles) {
1500 …if (!this.currentSubtitle || this.currentSubtitle.start >= time || this.currentSubtitle.end < time…
1504 reverse = (this.subtitles[this.lastSubtitleIndex].start > time),
1506 i = this.lastSubtitleIndex - (reverse) ? 1 : 0;
1509 …// Stop if no more, or this subtitle ends before the current time (no earlier subtitles should app…
1510 if (i < 0 || this.subtitles[i].end < time) { break; }
1511 // End is greater than time, so if start is less, show this subtitle
1512 if (this.subtitles[i].start < time) {
1518 … // Stop if no more, or this subtitle starts after time (no later subtitles should apply)
1519 if (i >= this.subtitles.length || this.subtitles[i].start > time) { break; }
1520 // Start is less than time, so if end is later, show this subtitle
1521 if (this.subtitles[i].end > time) {
1531 this.currentSubtitle = this.subtitles[newSubIndex];
1532 this.lastSubtitleIndex = newSubIndex;
1533 this.updateSubtitleDisplays(this.currentSubtitle.text);
1534 } else if (this.currentSubtitle) {
1535 this.currentSubtitle = false;
1536 this.updateSubtitleDisplays("");
1542 this.each(this.subtitleDisplays, function(disp){
1568 return this.merge(document.createElement(tagName), attributes);
1591 …return Math.max(0, Math.min(1, (x - this.findPosX(relativeElement)) / relativeElement.offsetWidth)…
1632 throw new Error("This browser does not support XMLHttpRequest.");
1641 }.context(this);
1701 var method = this,
1709 // But insteaad keep "this" intact, and passes the var as the second argument of the function
1713 var method = this,
1715 var origContext = this;
1726 if (this.hasContext === true) { return this; }
1729 if (funcParent[attrname] == this) {
1730 funcParent[attrname] = this.evtContext(obj);
1735 return this.evtContext(obj);
1742 this.each(function() {
1743 VideoJS.setup(this, options);
1745 return this;
1748 return this[0].player;