Trait/Object

com.karasiq.videojs

Player

Related Docs: object Player | package videojs

Permalink

trait Player extends Object with Component

Annotations
@RawJSType() @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. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. def $(selector: String, context: |[Element, String] = ???): Element

    Permalink
    Definition Classes
    Component
  4. def $$(selector: String, context: |[Element, String] = ???): NodeList

    Permalink
    Definition Classes
    Component
  5. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  6. def addChild(child: |[String, Component], options: Object = ???): Unit

    Permalink
    Definition Classes
    Component
  7. def addClass(classToAdd: String): Unit

    Permalink
    Definition Classes
    Component
  8. def addRemoteTextTrack(options: Object): Unit

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    Any
  11. def aspectRatio(ratio: String = ???): String

    Permalink

    Get/Set the aspect ratio

    Get/Set the aspect ratio

    ratio

    Aspect ratio for player

  12. def autoplay(value: Boolean = ???): Boolean

    Permalink

    Get or set the autoplay attribute.

    Get or set the autoplay attribute.

    value

    Boolean to determine if video should autoplay

  13. val bigPlayButton: Component

    Permalink
  14. def buffered(): TimeRanges

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    Component
  17. def canPlayType(type: String): Boolean

    Permalink

    Check whether the player can play a given mimetype

  18. def children(): Array[Component]

    Permalink
    Definition Classes
    Component
  19. def clearInterval(intervalId: Int): Unit

    Permalink
    Definition Classes
    Component
  20. def clearTimeout(timeoutId: Int): Unit

    Permalink
    Definition Classes
    Component
  21. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  22. def contentEl(): Element

    Permalink
    Definition Classes
    Component
  23. val controlBar: ControlBar

    Permalink
  24. def controlText(el: Element): Element

    Permalink
    Definition Classes
    Component
  25. def controls(bool: Boolean = ???): Boolean

    Permalink

    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

    Permalink

    Create the component's DOM element

  27. def createEl(tagName: String = ???, properties: Object = ???, attributes: Object = ???): Element

    Permalink
    Definition Classes
    Component
  28. def currentSrc(): String

    Permalink

    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

    Permalink

    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(): Int

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    Component
  34. def dispose(): Unit

    Permalink
    Definition Classes
    Component
  35. def duration(seconds: Int = ???): Int

    Permalink

    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

    Permalink
    Definition Classes
    Component
  37. def enableTouchActivity(): Unit

    Permalink
    Definition Classes
    Component
  38. def ended(): Boolean

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
  41. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  42. def error(): MediaError

    Permalink

    Get the current MediaError

    Get the current MediaError

    returns

    MediaError or null

  43. def error(err: |[|[MediaError, String], Int]): Player.this.type

    Permalink

    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

    Permalink

    Exit full window

  45. def exitFullscreen(): Unit

    Permalink

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

  46. def fluid(bool: Boolean): Unit

    Permalink

    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

    Permalink

    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

    Permalink

    Get object for cached values.

  49. def getChild(name: String): Component

    Permalink
    Definition Classes
    Component
  50. def getChildById(id: String): Component

    Permalink
    Definition Classes
    Component
  51. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  52. def handleBlur(): Unit

    Permalink
    Definition Classes
    Component
  53. def handleClick(): Unit

    Permalink
    Definition Classes
    Component
  54. def handleFocus(): Unit

    Permalink
    Definition Classes
    Component
  55. def handleKeyPress(): Unit

    Permalink
    Definition Classes
    Component
  56. def hasClass(classToCheck: String): Boolean

    Permalink
    Definition Classes
    Component
  57. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  58. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  59. def height(num: |[Int, String] = ???, skipListeners: Boolean = ???): Int

    Permalink
    Definition Classes
    Component
  60. def hide(): Unit

    Permalink
    Definition Classes
    Component
  61. def id(): String

    Permalink
    Definition Classes
    Component
  62. def initChildren(): Unit

    Permalink
    Definition Classes
    Component
  63. def isFullscreen(isFS: Boolean): Player.this.type

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    Any
  66. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  67. def language(code: String): Player.this.type

    Permalink

    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

    Permalink

    The player's language code

    The player's language code

    returns

    The locale string when getting

  69. def languages(): Array[String]

    Permalink

    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

    Permalink

    Begin loading the src data.

    Begin loading the src data.

    returns

    Returns the player

  71. val loadingSpinner: Component

    Permalink
  72. def loop(value: Boolean): Player.this.type

    Permalink

    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

    Permalink

    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

    Permalink

    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

    Permalink

    Get the current muted state

  76. def name(): String

    Permalink
    Definition Classes
    Component
  77. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  78. def networkState(): Int

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  80. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  81. def off(event: String, handler: Function): Player.this.type

    Permalink
    Definition Classes
    Component
  82. def off(component: Component, event: String, handler: Function): Player.this.type

    Permalink
    Definition Classes
    Component
  83. def on(event: String, handler: Function): Player.this.type

    Permalink
    Definition Classes
    Component
  84. def on(component: Component, event: String, handler: Function): Player.this.type

    Permalink
    Definition Classes
    Component
  85. def one(event: String, handler: Function): Player.this.type

    Permalink
    Definition Classes
    Component
  86. def one(component: Component, event: String, handler: Function): Player.this.type

    Permalink
    Definition Classes
    Component
  87. def options(obj: Object): Object

    Permalink
    Definition Classes
    Component
  88. def pause(): Player.this.type

    Permalink

    Pause the video playback

  89. def paused(): Boolean

    Permalink

    Check if the player is paused

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

    Permalink

    Start media playback

  91. def playbackRate(): Double

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    Component
  94. def poster(): String

    Permalink

    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

    Permalink

    Set the poster image source url

    Set the poster image source url

    src

    Poster image source URL

  96. val posterImage: Component

    Permalink
  97. def preload(): Boolean

    Permalink

    Get the preload attribute

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

    Permalink

    Set the preload attribute

    Set the preload attribute

    value

    Boolean to determine if preload should be used

  99. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  100. def ready(fn: Function, sync: Boolean): Player.this.type

    Permalink
    Definition Classes
    Component
  101. def readyState(): Int

    Permalink

    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

    Permalink

    Calculates how much time is left.

  103. def remoteTextTrackEls(): Array[Element]

    Permalink

    Get an array of remote html track elements

  104. def remoteTextTracks(): Array[String]

    Permalink

    Get an array of remote text tracks

  105. def removeChild(component: Component): Unit

    Permalink
    Definition Classes
    Component
  106. def removeClass(classToRemove: String): Unit

    Permalink
    Definition Classes
    Component
  107. def removeRemoteTextTrack(track: Object): Unit

    Permalink

    Remove a remote text track

    Remove a remote text track

    track

    Remote text track to remove

  108. def reportUserActivity(event: Object): Unit

    Permalink

    Report user activity

    Report user activity

    event

    Event object

  109. def requestFullscreen(): Unit

    Permalink

    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

    Permalink

    Reset the player.

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

  111. def scrubbing(): Boolean

    Permalink

    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

    Permalink

    isScrubbing

    True/false the user is scrubbing

  113. def seekable(): TimeRanges

    Permalink

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

  114. def seeking(): Boolean

    Permalink

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

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

    Permalink

    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

    Permalink
    Definition Classes
    Component
  117. def setTimeout(fn: Function, timeout: Int): Unit

    Permalink
    Definition Classes
    Component
  118. def show(): Unit

    Permalink
    Definition Classes
    Component
  119. def src(): String

    Permalink

    returns

    The current video source when getting

  120. def src(source: |[|[String, Array[VideoSource]], VideoSource]): Player.this.type

    Permalink

    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

    Permalink

    Check to see if fullscreen is supported

  122. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  123. def tech(safety: Object): Object

    Permalink

    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

    Permalink
  125. def textTracks(): Array[Object]

    Permalink

    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

    Permalink

    Converts track info to JSON

    Converts track info to JSON

    returns

    JSON object of options

  127. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  128. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  129. def toggleClass(classToToggle: String, predicate: |[Function, Boolean] = ???): Unit

    Permalink
    Definition Classes
    Component
  130. def trigger(event: |[Object, String], hash: Object = ???): Unit

    Permalink
    Definition Classes
    Component
  131. def triggerReady(): Unit

    Permalink
    Definition Classes
    Component
  132. def updateStyleEl_(): Unit

    Permalink

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

  133. def userActive(): Boolean

    Permalink

    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

    Permalink

    Set if user is active

    Set if user is active

    bool

    Value when setting

  135. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  136. def videoHeight(): Int

    Permalink

    Get video height

  137. def videoWidth(): Int

    Permalink

    Get video width

  138. def volume(): Double

    Permalink

    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

    Permalink

    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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  141. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  142. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  143. def width(num: |[Int, String], skipListeners: Boolean): Int

    Permalink
    Definition Classes
    Component

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from Component

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped