1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-13 10:32:26 +02:00

Fixed all uses of registerComponent that relied on __proto__ inheritance

This commit is contained in:
heff 2015-05-18 17:35:21 -07:00
parent dc083f8cf4
commit 1ffb13a799
23 changed files with 51 additions and 30 deletions

View File

@ -1,4 +1,5 @@
import Button from './button';
import Button from './button.js';
import Component from './component.js';
/* Big Play Button
================================================================================ */
@ -26,5 +27,5 @@ class BigPlayButton extends Button {
}
Button.registerComponent('BigPlayButton', BigPlayButton);
Component.registerComponent('BigPlayButton', BigPlayButton);
export default BigPlayButton;

View File

@ -1,4 +1,5 @@
import Button from '../button';
import Button from '../button.js';
import Component from '../component.js';
/**
* Toggle fullscreen video
@ -27,5 +28,5 @@ class FullscreenToggle extends Button {
FullscreenToggle.prototype.buttonText = 'Fullscreen';
Button.registerComponent('FullscreenToggle', FullscreenToggle);
Component.registerComponent('FullscreenToggle', FullscreenToggle);
export default FullscreenToggle;

View File

@ -1,4 +1,5 @@
import Button from '../button';
import Button from '../button.js';
import Component from '../component.js';
/**
* Button to toggle between play and pause
@ -47,5 +48,5 @@ class PlayToggle extends Button {
PlayToggle.prototype.buttonText = 'Play';
Button.registerComponent('PlayToggle', PlayToggle);
Component.registerComponent('PlayToggle', PlayToggle);
export default PlayToggle;

View File

@ -1,4 +1,5 @@
import MenuItem from '../../menu/menu-item.js';
import Component from '../../component.js';
/**
* The specific menu item type for selecting a playback rate
@ -35,5 +36,5 @@ class PlaybackRateMenuItem extends MenuItem {
PlaybackRateMenuItem.prototype.contentElType = 'button';
MenuItem.registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem);
Component.registerComponent('PlaybackRateMenuItem', PlaybackRateMenuItem);
export default PlaybackRateMenuItem;

View File

@ -1,4 +1,5 @@
import Slider from '../../slider/slider.js';
import Component from '../../component.js';
import LoadProgressBar from './load-progress-bar.js';
import PlayProgressBar from './play-progress-bar.js';
import SeekHandle from './seek-handle.js';
@ -90,5 +91,5 @@ SeekBar.prototype.options_ = {
SeekBar.prototype.playerEvent = 'timeupdate';
Slider.registerComponent('SeekBar', SeekBar);
Component.registerComponent('SeekBar', SeekBar);
export default SeekBar;

View File

@ -1,4 +1,5 @@
import SliderHandle from '../../slider/slider-handle.js';
import Component from '../../component.js';
import formatTime from '../../utils/format-time.js';
/**
@ -39,5 +40,5 @@ class SeekHandle extends SliderHandle {
*/
SeekHandle.prototype.defaultValue = '00:00';
SliderHandle.registerComponent('SeekHandle', SeekHandle);
Component.registerComponent('SeekHandle', SeekHandle);
export default SeekHandle;

View File

@ -1,4 +1,5 @@
import Spacer from './spacer.js';
import Component from '../../component.js';
/**
* Spacer specifically meant to be used as an insertion point for new plugins, etc.
@ -18,6 +19,5 @@ class CustomControlSpacer extends Spacer {
}
}
Spacer.registerComponent('CustomControlSpacer', CustomControlSpacer);
Component.registerComponent('CustomControlSpacer', CustomControlSpacer);
export default CustomControlSpacer;

View File

@ -1,4 +1,5 @@
import TextTrackMenuItem from './text-track-menu-item.js';
import Component from '../../component.js';
class CaptionSettingsMenuItem extends TextTrackMenuItem {
@ -21,5 +22,5 @@ class CaptionSettingsMenuItem extends TextTrackMenuItem {
}
TextTrackMenuItem.registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);
Component.registerComponent('CaptionSettingsMenuItem', CaptionSettingsMenuItem);
export default CaptionSettingsMenuItem;

View File

@ -1,4 +1,5 @@
import TextTrackButton from './text-track-button.js';
import Component from '../../component.js';
import CaptionSettingsMenuItem from './caption-settings-menu-item.js';
/**
@ -45,5 +46,5 @@ CaptionsButton.prototype.kind_ = 'captions';
CaptionsButton.prototype.buttonText = 'Captions';
CaptionsButton.prototype.className = 'vjs-captions-button';
TextTrackButton.registerComponent('CaptionsButton', CaptionsButton);
Component.registerComponent('CaptionsButton', CaptionsButton);
export default CaptionsButton;

View File

@ -1,4 +1,5 @@
import TextTrackButton from './text-track-button.js';
import Component from '../../component.js';
import TextTrackMenuItem from './text-track-menu-item.js';
import ChaptersTrackMenuItem from './chapters-track-menu-item.js';
import Menu from '../../menu/menu.js';
@ -107,5 +108,5 @@ ChaptersButton.prototype.kind_ = 'chapters';
ChaptersButton.prototype.buttonText = 'Chapters';
ChaptersButton.prototype.className = 'vjs-chapters-button';
TextTrackButton.registerComponent('ChaptersButton', ChaptersButton);
Component.registerComponent('ChaptersButton', ChaptersButton);
export default ChaptersButton;

View File

@ -1,4 +1,5 @@
import MenuItem from '../../menu/menu-item.js';
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
/**
@ -37,5 +38,5 @@ class ChaptersTrackMenuItem extends MenuItem {
}
MenuItem.registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem);
Component.registerComponent('ChaptersTrackMenuItem', ChaptersTrackMenuItem);
export default ChaptersTrackMenuItem;

View File

@ -1,4 +1,5 @@
import TextTrackMenuItem from './text-track-menu-item.js';
import Component from '../../component.js';
/**
* A special menu item for turning of a specific type of text track
@ -39,5 +40,5 @@ class OffTextTrackMenuItem extends TextTrackMenuItem {
}
TextTrackMenuItem.registerComponent('OffTextTrackMenuItem', OffTextTrackMenuItem);
export default OffTextTrackMenuItem;
Component.registerComponent('OffTextTrackMenuItem', OffTextTrackMenuItem);
export default OffTextTrackMenuItem;

View File

@ -1,4 +1,5 @@
import TextTrackButton from './text-track-button.js';
import Component from '../../component.js';
/**
* The button component for toggling and selecting subtitles
@ -18,5 +19,5 @@ SubtitlesButton.prototype.kind_ = 'subtitles';
SubtitlesButton.prototype.buttonText = 'Subtitles';
SubtitlesButton.prototype.className = 'vjs-subtitles-button';
TextTrackButton.registerComponent('SubtitlesButton', SubtitlesButton);
export default SubtitlesButton;
Component.registerComponent('SubtitlesButton', SubtitlesButton);
export default SubtitlesButton;

View File

@ -1,4 +1,5 @@
import MenuButton from '../../menu/menu-button.js';
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
import TextTrackMenuItem from './text-track-menu-item.js';
import OffTextTrackMenuItem from './off-text-track-menu-item.js';
@ -60,5 +61,5 @@ class TextTrackButton extends MenuButton {
}
MenuButton.registerComponent('TextTrackButton', TextTrackButton);
Component.registerComponent('TextTrackButton', TextTrackButton);
export default TextTrackButton;

View File

@ -1,4 +1,5 @@
import MenuItem from '../../menu/menu-item.js';
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
import window from 'global/window';
import document from 'global/document';
@ -86,5 +87,5 @@ class TextTrackMenuItem extends MenuItem {
}
MenuItem.registerComponent('TextTrackMenuItem', TextTrackMenuItem);
Component.registerComponent('TextTrackMenuItem', TextTrackMenuItem);
export default TextTrackMenuItem;

View File

@ -1,4 +1,5 @@
import Slider from '../../slider/slider.js';
import Component from '../../component.js';
import * as Fn from '../../utils/fn.js';
import roundFloat from '../../utils/round-float.js';
@ -71,5 +72,5 @@ VolumeBar.prototype.options_ = {
VolumeBar.prototype.playerEvent = 'volumechange';
Slider.registerComponent('VolumeBar', VolumeBar);
Component.registerComponent('VolumeBar', VolumeBar);
export default VolumeBar;

View File

@ -1,4 +1,5 @@
import SliderHandle from '../../slider/slider-handle.js';
import Component from '../../component.js';
/**
* The volume handle can be dragged to adjust the volume level
@ -20,5 +21,5 @@ class VolumeHandle extends SliderHandle {
VolumeHandle.prototype.defaultValue = '00:00';
SliderHandle.registerComponent('VolumeHandle', VolumeHandle);
Component.registerComponent('VolumeHandle', VolumeHandle);
export default VolumeHandle;

View File

@ -1,4 +1,5 @@
import Button from '../button.js';
import Component from '../component.js';
import Menu from '../menu/menu.js';
import MenuButton from '../menu/menu-button.js';
import MuteToggle from './mute-toggle.js';
@ -67,5 +68,5 @@ class VolumeMenuButton extends MenuButton {
VolumeMenuButton.prototype.volumeUpdate = MuteToggle.prototype.update;
Button.registerComponent('VolumeMenuButton', VolumeMenuButton);
Component.registerComponent('VolumeMenuButton', VolumeMenuButton);
export default VolumeMenuButton;

View File

@ -1,4 +1,5 @@
import Button from '../button.js';
import Component from '../component.js';
import Menu from './menu.js';
import * as Dom from '../utils/dom.js';
import * as Fn from '../utils/fn.js';
@ -139,5 +140,5 @@ class MenuButton extends Button {
}
}
Button.registerComponent('MenuButton', MenuButton);
Component.registerComponent('MenuButton', MenuButton);
export default MenuButton;

View File

@ -1,4 +1,5 @@
import Button from '../button.js';
import Component from '../component.js';
import assign from 'object.assign';
/**
@ -47,5 +48,5 @@ class MenuItem extends Button {
}
Button.registerComponent('MenuItem', MenuItem);
Component.registerComponent('MenuItem', MenuItem);
export default MenuItem;

View File

@ -1,4 +1,5 @@
import Button from './button';
import Button from './button.js';
import Component from './component.js';
import * as Fn from './utils/fn.js';
import * as Dom from './utils/dom.js';
import * as browser from './utils/browser.js';
@ -103,5 +104,5 @@ class PosterImage extends Button {
}
Button.registerComponent('PosterImage', PosterImage);
Component.registerComponent('PosterImage', PosterImage);
export default PosterImage;

View File

@ -394,5 +394,5 @@ Flash.getEmbedCode = function(swf, flashVars, params, attributes){
// Run Flash through the RTMP decorator
FlashRtmpDecorator(Flash);
Tech.registerComponent('Flash', Flash);
Component.registerComponent('Flash', Flash);
export default Flash;

View File

@ -2,6 +2,7 @@
// can run without HTML5 or Flash, of which PhantomJS supports neither.
import Tech from '../../../src/js/tech/tech.js';
import Component from '../../../src/js/component.js';
/**
* @constructor
@ -51,5 +52,5 @@ class TechFaker extends Tech {
static canPlaySource(srcObj) { return srcObj.type !== 'video/unsupported-format'; }
}
Tech.registerComponent('TechFaker', TechFaker);
Component.registerComponent('TechFaker', TechFaker);
export default TechFaker;