trait Player extends Object with Component
- Annotations
- @JSType() @native()
- See also
- Alphabetic
- By Inheritance
- Player
- Component
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def $(selector: String, context: |[Element, String] = ???): Element
- Definition Classes
- Component
- def $$(selector: String, context: |[Element, String] = ???): NodeList[Node]
- Definition Classes
- Component
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addChild(child: |[String, Component], options: Object = ???): Unit
- Definition Classes
- Component
- def addClass(classToAdd: String): Unit
- Definition Classes
- Component
- def addRemoteTextTrack(options: Object): Unit
Add a remote text track
Add a remote text track
- options
Options for remote text track
- def addTextTrack(kind: String, label: String = ???, language: String = ???): Unit
Add a text track In addition to the W3C settings we allow adding additional info through options.
Add a text track In addition to the W3C settings we allow adding additional info through options. http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-addtexttrack
- kind
Captions, subtitles, chapters, descriptions, or metadata
- label
Optional label
- language
Optional language
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def aspectRatio(ratio: String = ???): String
Get/Set the aspect ratio
Get/Set the aspect ratio
- ratio
Aspect ratio for player
- def autoplay(value: Boolean = ???): Boolean
Get or set the autoplay attribute.
Get or set the autoplay attribute.
- value
Boolean to determine if video should autoplay
- val bigPlayButton: Component
- def buffered(): TimeRanges
Get a TimeRange object with the times of the video that have been downloaded If you just want the percent of the video that's been downloaded, use bufferedPercent.
Get a TimeRange object with the times of the video that have been downloaded If you just want the percent of the video that's been downloaded, use bufferedPercent.
- returns
TimeRange object
- def bufferedPercent(): Double
Get the percent (as a decimal) of the video that's been downloaded.
Get the percent (as a decimal) of the video that's been downloaded. 0 means none, 1 means all. (This method isn't in the HTML5 spec, but it's very convenient)
- returns
The end of the last buffered time range
var howMuchIsDownloaded = myPlayer.bufferedPercent();
Example: - def buildCSSClass(): String
- Definition Classes
- Component
- def canPlayType(type: String): Boolean
Check whether the player can play a given mimetype
- def children(): Array[Component]
- Definition Classes
- Component
- def clearInterval(intervalId: Int): Unit
- Definition Classes
- Component
- def clearTimeout(timeoutId: Int): Unit
- Definition Classes
- Component
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- def contentEl(): Element
- Definition Classes
- Component
- val controlBar: ControlBar
- def controlText(el: Element): Element
- Definition Classes
- Component
- def controls(bool: Boolean = ???): Boolean
Get or set whether or not the controls are showing.
Get or set whether or not the controls are showing.
- bool
Set controls to showing or not
- returns
Controls are showing
- def createEl(): Element
Create the component's DOM element
- def createEl(tagName: String = ???, properties: Object = ???, attributes: Object = ???): Element
- Definition Classes
- Component
- def currentSrc(): String
Returns the fully qualified URL of the current source value e.g.
Returns the fully qualified URL of the current source value e.g.
http://mysite.com/video.mp4Can be used in conjuction with currentType to assist in rebuilding the current source object. - def currentTime(seconds: |[Int, String] = ???): Player.this.type
Set the current time (in seconds)
Set the current time (in seconds)
- seconds
The time to seek to
- returns
Self, when the current time is set
myPlayer.currentTime(120); // 2 minutes into the video
Example: - def currentTime(): Double
Get the current time (in seconds)
Get the current time (in seconds)
- returns
The time in seconds, when not setting
var whereYouAt = myPlayer.currentTime();
Example: - def currentType(): String
Get the current source type e.g.
Get the current source type e.g. video/mp4. This can allow you rebuild the current source object so that you could load the same source and tech later.
- def dimension(dimension: String, value: Int = ???): Int
Get/set dimension for player
Get/set dimension for player
- dimension
Either width or height
- value
Value for dimension
- returns
Height when getting
- def dimensions(width: |[Int, String], height: |[Int, String]): Unit
- Definition Classes
- Component
- def dispose(): Unit
- Definition Classes
- Component
- def duration(seconds: Int = ???): Int
Get the length in time of the video in seconds
Get the length in time of the video in seconds
- seconds
Duration when setting
- returns
The duration of the video in seconds when getting
- Note
The video must have started loading before the duration can be known, and in the case of Flash, may not be known until the video starts playing.
- def el(): Element
- Definition Classes
- Component
- def enableTouchActivity(): Unit
- Definition Classes
- Component
- def ended(): Boolean
Returns whether or not the player is in the "ended" state.
Returns whether or not the player is in the "ended" state.
- returns
True if the player is in the ended state, false if not.
- def enterFullWindow(): Unit
When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def error(): MediaError
Get the current MediaError
Get the current MediaError
- returns
MediaError or
null
- def error(err: |[|[MediaError, String], Int]): Player.this.type
Set the current MediaError
Set the current MediaError
- err
A MediaError or a String/Number to be turned into a MediaError
- returns
Player
- def exitFullWindow(): Unit
Exit full window
- def exitFullscreen(): Unit
Return the video to its normal size after having been in full screen mode
- def fluid(bool: Boolean): Unit
Add/remove the vjs-fluid class
Add/remove the vjs-fluid class
- bool
Value of true adds the class, value of false removes the class
- def fullWindowOnEscKey(event: String): Unit
Check for call to either exit full window or full screen on ESC key
Check for call to either exit full window or full screen on ESC key
- event
Event to check for key press
- def getCache(): Object
Get object for cached values.
- def getChild(name: String): Component
- Definition Classes
- Component
- def getChildById(id: String): Component
- Definition Classes
- Component
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def handleBlur(): Unit
- Definition Classes
- Component
- def handleClick(): Unit
- Definition Classes
- Component
- def handleFocus(): Unit
- Definition Classes
- Component
- def handleKeyPress(): Unit
- Definition Classes
- Component
- def hasClass(classToCheck: String): Boolean
- Definition Classes
- Component
- def hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def height(num: |[Int, String] = ???, skipListeners: Boolean = ???): Int
- Definition Classes
- Component
- def hide(): Unit
- Definition Classes
- Component
- def id(): String
- Definition Classes
- Component
- def initChildren(): Unit
- Definition Classes
- Component
- def isFullscreen(isFS: Boolean): Player.this.type
Tell the player it's in fullscreen
Tell the player it's in fullscreen
- isFS
Update the player's fullscreen state
- returns
Self
- def isFullscreen(): Boolean
Check if the player is in fullscreen mode
Check if the player is in fullscreen mode
- Note
As of the latest HTML5 spec, isFullscreen is no longer an official property and instead document.fullscreenElement is used. But isFullscreen is still a valuable property for internal player workings.
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- def language(code: String): Player.this.type
The player's language code
The player's language code
- code
The locale string
- returns
Self when setting
- Note
The language should be set in the player options if you want the the controls to be built with a specific language. Changing the lanugage later will not update controls text.
- def language(): String
The player's language code
The player's language code
- returns
The locale string when getting
- def languages(): Array[String]
Get the player's language dictionary Merge every time, because a newly added plugin might call videojs.addLanguage() at any time Languages specified directly in the player options have precedence
Get the player's language dictionary Merge every time, because a newly added plugin might call videojs.addLanguage() at any time Languages specified directly in the player options have precedence
- returns
Array of languages
- def load(): Player.this.type
Begin loading the src data.
Begin loading the src data.
- returns
Returns the player
- val loadingSpinner: Component
- def loop(value: Boolean): Player.this.type
Set the loop attribute on the video element.
Set the loop attribute on the video element.
- value
Boolean to determine if video should loop
- returns
Returns the player when setting
- def loop(): Boolean
Get the loop attribute on the video element.
Get the loop attribute on the video element.
- returns
The loop attribute value when getting
- def muted(value: Boolean): Player.this.type
Turn mute on or off
Turn mute on or off
- value
True to mute, false to unmute
- returns
Returns the player when setting
- def muted(): Boolean
Get the current muted state
- def name(): String
- Definition Classes
- Component
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def networkState(): Int
Returns the current state of network activity for the element, from the codes in the list below.
Returns the current state of network activity for the element, from the codes in the list below.
- NETWORK_EMPTY (numeric value 0) The element has not yet been initialised. All attributes are in their initial states.
- NETWORK_IDLE (numeric value 1) The element's resource selection algorithm is active and has selected a resource, but it is not actually using the network at this time.
- NETWORK_LOADING (numeric value 2) The user agent is actively trying to download data.
- NETWORK_NO_SOURCE (numeric value 3) The element's resource selection algorithm is active, but it has not yet found a resource to use.
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- def off(event: String, handler: Function): Unit
- Definition Classes
- Component
- def off(component: Component, event: String, handler: Function): Unit
- Definition Classes
- Component
- def on(event: String, handler: Function): Unit
- Definition Classes
- Component
- def on(component: Component, event: String, handler: Function): Unit
- Definition Classes
- Component
- def one(event: String, handler: Function): Unit
- Definition Classes
- Component
- def one(component: Component, event: String, handler: Function): Unit
- Definition Classes
- Component
- def options(obj: Object): Object
- Definition Classes
- Component
- def pause(): Player.this.type
Pause the video playback
- def paused(): Boolean
Check if the player is paused
- def play(): Player.this.type
Start media playback
- def playbackRate(): Double
Gets the current playback rate.
Gets the current playback rate. A playback rate of 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.
- def playbackRate(rate: Double): Player.this.type
Sets the current playback rate.
Sets the current playback rate. A playback rate of 1.0 represents normal speed and 0.5 would indicate half-speed playback, for instance.
- rate
New playback rate to set.
- def player(): Player
- Definition Classes
- Component
- def poster(): String
Get the poster image source url
Get the poster image source url
- returns
Poster image source URL
- def poster(src: String): Player.this.type
Set the poster image source url
Set the poster image source url
- src
Poster image source URL
- val posterImage: Component
- def preload(): Boolean
Get the preload attribute
- def preload(value: Boolean): Player.this.type
Set the preload attribute
Set the preload attribute
- value
Boolean to determine if preload should be used
- def propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
- def ready(fn: Function, sync: Boolean): Player.this.type
- Definition Classes
- Component
- def readyState(): Int
Returns a value that expresses the current state of the element with respect to rendering the current playback position, from the codes in the list below.
Returns a value that expresses the current state of the element with respect to rendering the current playback position, from the codes in the list below.
- HAVE_NOTHING (numeric value 0) No information regarding the media resource is available.
- HAVE_METADATA (numeric value 1) Enough of the resource has been obtained that the duration of the resource is available.
- HAVE_CURRENT_DATA (numeric value 2) Data for the immediate current playback position is available.
- HAVE_FUTURE_DATA (numeric value 3) Data for the immediate current playback position is available, as well as enough data for the user agent to advance the current playback position in the direction of playback.
- HAVE_ENOUGH_DATA (numeric value 4) The user agent estimates that enough data is available for playback to proceed uninterrupted.
- def remainingTime(): Int
Calculates how much time is left.
- def remoteTextTrackEls(): Array[Element]
Get an array of remote html track elements
- def remoteTextTracks(): Array[String]
Get an array of remote text tracks
- def removeChild(component: Component): Unit
- Definition Classes
- Component
- def removeClass(classToRemove: String): Unit
- Definition Classes
- Component
- def removeRemoteTextTrack(track: Object): Unit
Remove a remote text track
Remove a remote text track
- track
Remote text track to remove
- def reportUserActivity(event: Object): Unit
Report user activity
Report user activity
- event
Event object
- def requestFullscreen(): Unit
Increase the size of the video to full screen In some browsers, full screen is not supported natively, so it enters "full window mode", where the video fills the browser window.
Increase the size of the video to full screen In some browsers, full screen is not supported natively, so it enters "full window mode", where the video fills the browser window. In browsers and devices that support native full screen, sometimes the browser's default controls will be shown, and not the Video.js custom skin. This includes most mobile devices (iOS, Android) and older versions of Safari.
- def reset(): Player.this.type
Reset the player.
Reset the player. Loads the first tech in the techOrder, and calls
reseton thetech. - def scrubbing(): Boolean
Returns whether or not the user is "scrubbing".
Returns whether or not the user is "scrubbing". Scrubbing is when the user has clicked the progress bar handle and is dragging it along the progress bar.
- def scrubbing(isScrubbing: Boolean): Player.this.type
- isScrubbing
True/false the user is scrubbing
- def seekable(): TimeRanges
Returns the TimeRanges of the media that are currently available for seeking to.
- def seeking(): Boolean
Returns whether or not the player is in the "seeking" state.
- def selectSource(sources: Array[VideoSource]): |[Object, Boolean]
Select source based on tech-order or source-order Uses source-order selection if
options.sourceOrderis truthy.Select source based on tech-order or source-order Uses source-order selection if
options.sourceOrderis truthy. Otherwise, defaults to tech-order selection- sources
The sources for a media asset
- returns
Object of source and tech order, otherwise false
- def setInterval(fn: Function, interval: Int): Unit
- Definition Classes
- Component
- def setTimeout(fn: Function, timeout: Int): Unit
- Definition Classes
- Component
- def show(): Unit
- Definition Classes
- Component
- def src(): String
- returns
The current video source when getting
- def src(source: |[|[String, Array[VideoSource]], VideoSource]): Player.this.type
The source function updates the video source.
The source function updates the video source. There are three types of variables you can pass as the argument.
- URL String: A URL to the the video file. Use this method if you are sure the current playback technology (HTML5/Flash) can support the source you provide. Currently only MP4 files can be used in both HTML5 and Flash.
- Source Object (or element): A javascript object containing information about the source file. Use this method if you want the player to determine if it can support the file using the type information.
- Array of Source Objects: To provide multiple versions of the source so that it can be played using HTML5 across browsers you can use an array of source objects. Video.js will detect which version is supported and load that file.
- source
The source URL, object, or array of sources
- returns
The player when setting
- def supportsFullScreen(): Boolean
Check to see if fullscreen is supported
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tech(safety: Object): Object
Return a reference to the current tech.
Return a reference to the current tech. It will only return a reference to the tech if given an object with the IWillNotUseThisInPlugins property on it. This is try and prevent misuse of techs by plugins.
- returns
The Tech
- val textTrackDisplay: Component
- def textTracks(): Array[Object]
Get an array of associated text tracks.
Get an array of associated text tracks. captions, subtitles, chapters, descriptions
- returns
Array of track objects
- def toJSON(): Object
Converts track info to JSON
Converts track info to JSON
- returns
JSON object of options
- def toLocaleString(): String
- Definition Classes
- Object
- def toString(): String
- Definition Classes
- AnyRef → Any
- def toggleClass(classToToggle: String, predicate: |[Function, Boolean] = ???): Unit
- Definition Classes
- Component
- def trigger(event: |[Object, String], hash: Object = ???): Unit
- Definition Classes
- Component
- def triggerReady(): Unit
- Definition Classes
- Component
- def updateStyleEl_(): Unit
Update styles of the player element (height, width and aspect ratio)
- def userActive(): Boolean
Get if user is active
Get if user is active
- returns
Value if user is active user when getting
- def userActive(bool: Boolean): Player.this.type
Set if user is active
Set if user is active
- bool
Value when setting
- def valueOf(): Any
- Definition Classes
- Object
- def videoHeight(): Int
Get video height
- def videoWidth(): Int
Get video width
- def volume(): Double
Get the current volume of the media 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
- def volume(percentAsDecimal: Double): Player.this.type
Set the current volume of the media 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
Set the current volume of the media 0 is off (muted), 1.0 is all the way up, 0.5 is half way.
- percentAsDecimal
The new volume as a decimal percent
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def width(num: |[Int, String], skipListeners: Boolean): Int
- Definition Classes
- Component
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated