Z.Video

Studio

Z.Video

Inherits from Z.Texture

ZapWorks Studio contains a Video Player Symbol built upon Z.Video.

Description

The Z.Video object allows playback of streaming video in the 3D view using a URL to a hosted video file.

The URL needs to link directly to a video file as opposed to one uploaded to a video hosting site such as Vimeo or YouTube. The server hosting the video file also needs to support range requests in order for the video to play properly across all devices. We recommend using a CDN for faster, more scalable video serving e.g. AWS CloudFront or CloudFlare.

Zappar uses the device's built-in video functionality to provide this feature. The following format is supported across a wide range of mobile devices, and is the recommended format for video played with Z.Video:

  • MP4
  • "Web-optimized" with the index at the start of the file
  • Baseline or Main profile
  • 800 kbps bitrate in order to support playback over cellular connections

Z.Video supports HLS (HTTP Live Streaming), a format that automatically adjusts the quality of a video stream between multiple bitrates and resolutions, based on the bandwidth capacity of a users device. For more information see the Wikipedia article.

Provided by Z.Video

Constructor

Z.Video(...) Constructs a new Z.Video object.

Enumerations

ErrorReason The reason for an error occurring.

Events

aspectratio Emitted when the aspect ratio of the video is known, or subsequently changes.
buffering Emitted when more data must be downloaded before playback can continue.
duration Emitted when the duration of the video is known, or subsequently changes.
error Emitted when there's an issue with video playback.
finish Emitted when the video completes.
pause Emitted when the video is paused.
playing Emitted when playback first occurs.
resize Emitted when the width/height in pixels of the video is known, or subsequently changes.
time Emitted when the seek position of playback changes.

Functions

aspectRatio( ) Gets the aspect ratio of the video file.
duration( ) Gets the duration of the video file in milliseconds.
pause( ) Pauses playback at the current seek position.
restart( ) Restarts playback from the start of the video.
size( ) Gets the resolution of the video file in pixels.
source( ) Gets the URL of the video file.
source(...) Sets the URL of the video file.
start( ) Continues playback from the current seek position.
time( ) Gets the current seek time in milliseconds.
time(...) Seeks the video to the specified time in milliseconds.
volume( ) Gets the current volume.
volume(...) Sets the current volume.

Inherited from Z.Texture

Enumerations

Channel A color channel of a texture.
Mipmap The mipmapping mode for textures.
Wrap The wrap mode for textures.

Functions

mipmap( ) Gets the mipmapping mode of the texture.
mipmap(...) Sets the mipmapping mode of the texture.
position( ) Gets the position offset of the texture.
position(...) Sets the position offset of the texture.
rotation( ) Gets the rotation of the texture.
rotation(...) Sets the rotation of the texture.
scale( ) Gets the scale of the texture.
scale(...) Sets the scale of the texture.
size( ) Gets the size of the texture.
wrap( ) Gets the wrap mode of the texture.
wrap(...) Sets the wrap mode of the texture.

Inherited from Z.Base

Functions

emit(...) Calls the handler functions attached to an event.
hasTag(...) Returns true if this object has the specified tag.
off(...) Removes a handler function from an event.
on(...) Attaches a handler function to an event.
one(...) Attaches a single-use handler function to an event.
pushTag(...) Adds a tag to this object.
removeTag(...) Removes a tag from this object.
tags( ) Gets an array of the tags that this object belongs to.
tags(...) Sets the array of the tags that this object belongs to.
Open in new window