Class

io.scalajs.dom.html.phaser

Video

Related Doc: package phaser

Permalink

class Video extends Object

A Video object that takes a previously loaded Video from the Phaser Cache and handles playback of it.

Alternatively it takes a getUserMedia feed from an active webcam and streams the contents of that to the Video instead (see startMediaStream method)

The video can then be applied to a Sprite as a texture. If multiple Sprites share the same Video texture and playback changes (i.e. you pause the video, or seek to a new time) then this change will be seen across all Sprites simultaneously.

Due to a bug in IE11 you cannot play a video texture to a Sprite in WebGL. For IE11 force Canvas mode.

If you need each Sprite to be able to play a video fully independently then you will need one Video object per Sprite. Please understand the obvious performance implications of doing this, and the memory required to hold videos in RAM.

On some mobile browsers such as iOS Safari, you cannot play a video until the user has explicitly touched the screen. This works in the same way as audio unlocking. Phaser will handle the touch unlocking for you, however unlike with audio it's worth noting that every single Video needs to be touch unlocked, not just the first one. You can use the changeSource method to try and work around this limitation, but see the method help for details.

Small screen devices, especially iPod and iPhone will launch the video in its own native video player, outside of the Safari browser. There is no way to avoid this, it's a device imposed limitation.

Note: On iOS if you need to detect when the user presses the 'Done' button (before the video ends) then you need to add your own event listener

Annotations
@RawJSType() @native()
See also

http://phaser.io/docs/2.6.2/Phaser.Video.html

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

Instance Constructors

  1. new Video(game: Phaser.Game, key: String, url: String)

    Permalink

    game

    A reference to the currently running game.

    key

    The key of the video file in the Phaser.Cache that this Video object will play. Set to null or leave undefined if you wish to use a webcam as the source. See startMediaStream to start webcam capture.

    url

    If the video hasn't been loaded then you can provide a full URL to the file here (make sure to set key to null)

Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. var game: Phaser.Game

    Permalink

    A reference to the currently running game.

  10. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  11. def hasOwnProperty(v: String): Boolean

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

    Permalink
    Definition Classes
    AnyRef → Any
  13. final def isInstanceOf[T0]: Boolean

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

    Permalink
    Definition Classes
    Object
  15. var key: String

    Permalink

    The key of the video file in the Phaser.Cache that this Video object will play.

    The key of the video file in the Phaser.Cache that this Video object will play. Set to null or leave undefined if you wish to use a webcam as the source. See startMediaStream to start webcam capture.

  16. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  19. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toLocaleString(): String

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

    Permalink
    Definition Classes
    AnyRef → Any
  23. var url: String

    Permalink

    If the video hasn't been loaded then you can provide a full URL to the file here (make sure to set key to null)

  24. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  25. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  26. final def wait(arg0: Long, arg1: Int): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped