trait Player extends Object with Component

Annotations
@JSType() @native()
See also

http://docs.videojs.com/docs/api/player.html

Linear Supertypes
Component, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Player
  2. Component
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. def $(selector: String, context: |[Element, String] = ???): Element
    Definition Classes
    Component
  4. def $$(selector: String, context: |[Element, String] = ???): NodeList[Node]
    Definition Classes
    Component
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. def addChild(child: |[String, Component], options: Object = ???): Unit
    Definition Classes
    Component
  7. def addClass(classToAdd: String): Unit
    Definition Classes
    Component
  8. def addRemoteTextTrack(options: Object): Unit

    Add a remote text track

    Add a remote text track

    options

    Options for remote text track

  9. 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

  10. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  11. def aspectRatio(ratio: String = ???): String

    Get/Set the aspect ratio

    Get/Set the aspect ratio

    ratio

    Aspect ratio for player

  12. 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

  13. val bigPlayButton: Component
  14. 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

  15. 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

    Example:
    1. var howMuchIsDownloaded = myPlayer.bufferedPercent();
  16. def buildCSSClass(): String
    Definition Classes
    Component
  17. def canPlayType(type: String): Boolean

    Check whether the player can play a given mimetype

  18. def children(): Array[Component]
    Definition Classes
    Component
  19. def clearInterval(intervalId: Int): Unit
    Definition Classes
    Component
  20. def clearTimeout(timeoutId: Int): Unit
    Definition Classes
    Component
  21. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
  22. def contentEl(): Element
    Definition Classes
    Component
  23. val controlBar: ControlBar
  24. def controlText(el: Element): Element
    Definition Classes
    Component
  25. 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

  26. def createEl(): Element

    Create the component's DOM element

  27. def createEl(tagName: String = ???, properties: Object = ???, attributes: Object = ???): Element
    Definition Classes
    Component
  28. 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.mp4 Can be used in conjuction with currentType to assist in rebuilding the current source object.

  29. 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

    Example:
    1. myPlayer.currentTime(120); // 2 minutes into the video
  30. def currentTime(): Double

    Get the current time (in seconds)

    Get the current time (in seconds)

    returns

    The time in seconds, when not setting

    Example:
    1. var whereYouAt = myPlayer.currentTime();
  31. 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.

  32. 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

  33. def dimensions(width: |[Int, String], height: |[Int, String]): Unit
    Definition Classes
    Component
  34. def dispose(): Unit
    Definition Classes
    Component
  35. 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.

  36. def el(): Element
    Definition Classes
    Component
  37. def enableTouchActivity(): Unit
    Definition Classes
    Component
  38. 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.

  39. def enterFullWindow(): Unit

    When fullscreen isn't supported we can stretch the video container to as wide as the browser will let us.

  40. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  41. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  42. def error(): MediaError

    Get the current MediaError

    Get the current MediaError

    returns

    MediaError or null

  43. 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

  44. def exitFullWindow(): Unit

    Exit full window

  45. def exitFullscreen(): Unit

    Return the video to its normal size after having been in full screen mode

  46. 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

  47. 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

  48. def getCache(): Object

    Get object for cached values.

  49. def getChild(name: String): Component
    Definition Classes
    Component
  50. def getChildById(id: String): Component
    Definition Classes
    Component
  51. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  52. def handleBlur(): Unit
    Definition Classes
    Component
  53. def handleClick(): Unit
    Definition Classes
    Component
  54. def handleFocus(): Unit
    Definition Classes
    Component
  55. def handleKeyPress(): Unit
    Definition Classes
    Component
  56. def hasClass(classToCheck: String): Boolean
    Definition Classes
    Component
  57. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  58. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @IntrinsicCandidate()
  59. def height(num: |[Int, String] = ???, skipListeners: Boolean = ???): Int
    Definition Classes
    Component
  60. def hide(): Unit
    Definition Classes
    Component
  61. def id(): String
    Definition Classes
    Component
  62. def initChildren(): Unit
    Definition Classes
    Component
  63. 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

  64. 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.

  65. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  66. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  67. 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.

  68. def language(): String

    The player's language code

    The player's language code

    returns

    The locale string when getting

  69. 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

  70. def load(): Player.this.type

    Begin loading the src data.

    Begin loading the src data.

    returns

    Returns the player

  71. val loadingSpinner: Component
  72. 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

  73. 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

  74. 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

  75. def muted(): Boolean

    Get the current muted state

  76. def name(): String
    Definition Classes
    Component
  77. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  78. 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.
  79. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  80. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @IntrinsicCandidate()
  81. def off(event: String, handler: Function): Unit
    Definition Classes
    Component
  82. def off(component: Component, event: String, handler: Function): Unit
    Definition Classes
    Component
  83. def on(event: String, handler: Function): Unit
    Definition Classes
    Component
  84. def on(component: Component, event: String, handler: Function): Unit
    Definition Classes
    Component
  85. def one(event: String, handler: Function): Unit
    Definition Classes
    Component
  86. def one(component: Component, event: String, handler: Function): Unit
    Definition Classes
    Component
  87. def options(obj: Object): Object
    Definition Classes
    Component
  88. def pause(): Player.this.type

    Pause the video playback

  89. def paused(): Boolean

    Check if the player is paused

  90. def play(): Player.this.type

    Start media playback

  91. 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.

  92. 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.

  93. def player(): Player
    Definition Classes
    Component
  94. def poster(): String

    Get the poster image source url

    Get the poster image source url

    returns

    Poster image source URL

  95. def poster(src: String): Player.this.type

    Set the poster image source url

    Set the poster image source url

    src

    Poster image source URL

  96. val posterImage: Component
  97. def preload(): Boolean

    Get the preload attribute

  98. def preload(value: Boolean): Player.this.type

    Set the preload attribute

    Set the preload attribute

    value

    Boolean to determine if preload should be used

  99. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  100. def ready(fn: Function, sync: Boolean): Player.this.type
    Definition Classes
    Component
  101. 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.
  102. def remainingTime(): Int

    Calculates how much time is left.

  103. def remoteTextTrackEls(): Array[Element]

    Get an array of remote html track elements

  104. def remoteTextTracks(): Array[String]

    Get an array of remote text tracks

  105. def removeChild(component: Component): Unit
    Definition Classes
    Component
  106. def removeClass(classToRemove: String): Unit
    Definition Classes
    Component
  107. def removeRemoteTextTrack(track: Object): Unit

    Remove a remote text track

    Remove a remote text track

    track

    Remote text track to remove

  108. def reportUserActivity(event: Object): Unit

    Report user activity

    Report user activity

    event

    Event object

  109. 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.

  110. def reset(): Player.this.type

    Reset the player.

    Reset the player. Loads the first tech in the techOrder, and calls reset on the tech.

  111. 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.

  112. def scrubbing(isScrubbing: Boolean): Player.this.type

    isScrubbing

    True/false the user is scrubbing

  113. def seekable(): TimeRanges

    Returns the TimeRanges of the media that are currently available for seeking to.

  114. def seeking(): Boolean

    Returns whether or not the player is in the "seeking" state.

  115. def selectSource(sources: Array[VideoSource]): |[Object, Boolean]

    Select source based on tech-order or source-order Uses source-order selection if options.sourceOrder is truthy.

    Select source based on tech-order or source-order Uses source-order selection if options.sourceOrder is truthy. Otherwise, defaults to tech-order selection

    sources

    The sources for a media asset

    returns

    Object of source and tech order, otherwise false

  116. def setInterval(fn: Function, interval: Int): Unit
    Definition Classes
    Component
  117. def setTimeout(fn: Function, timeout: Int): Unit
    Definition Classes
    Component
  118. def show(): Unit
    Definition Classes
    Component
  119. def src(): String

    returns

    The current video source when getting

  120. 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

  121. def supportsFullScreen(): Boolean

    Check to see if fullscreen is supported

  122. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  123. 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

  124. val textTrackDisplay: Component
  125. 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

    See also

    http://www.w3.org/html/wg/drafts/html/master/embedded-content-0.html#dom-media-texttracks

  126. def toJSON(): Object

    Converts track info to JSON

    Converts track info to JSON

    returns

    JSON object of options

  127. def toLocaleString(): String
    Definition Classes
    Object
  128. def toString(): String
    Definition Classes
    AnyRef → Any
  129. def toggleClass(classToToggle: String, predicate: |[Function, Boolean] = ???): Unit
    Definition Classes
    Component
  130. def trigger(event: |[Object, String], hash: Object = ???): Unit
    Definition Classes
    Component
  131. def triggerReady(): Unit
    Definition Classes
    Component
  132. def updateStyleEl_(): Unit

    Update styles of the player element (height, width and aspect ratio)

  133. def userActive(): Boolean

    Get if user is active

    Get if user is active

    returns

    Value if user is active user when getting

  134. def userActive(bool: Boolean): Player.this.type

    Set if user is active

    Set if user is active

    bool

    Value when setting

  135. def valueOf(): Any
    Definition Classes
    Object
  136. def videoHeight(): Int

    Get video height

  137. def videoWidth(): Int

    Get video width

  138. 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.

  139. 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

  140. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  141. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  142. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  143. def width(num: |[Int, String], skipListeners: Boolean): Int
    Definition Classes
    Component

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from Component

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped