Video"

From Documentation
(Created page with "= Video = *Java API: <javadoc>org.zkoss.zkmax.zul.Video</javadoc> *JavaScript API: <javadoc directory="jsdoc">zkmax.med.Video</javadoc> = Employment/Purpose = An <tt>video</tt>...")
 
Line 32: Line 32:
 
= turnOffLight =
 
= turnOffLight =
 
The video component provides theater mode, If turnOffLight="true", the whole page will cover by translucent black except <video>.
 
The video component provides theater mode, If turnOffLight="true", the whole page will cover by translucent black except <video>.
 +
When theater mode is enabled, user can click anywhere on the page except the Video to disable theater mode.
  
 
[[Image:Player-turnOffLight.png]]
 
[[Image:Player-turnOffLight.png]]

Revision as of 04:50, 19 April 2018

Video

Employment/Purpose

An video component is used to play the video at the browser. Like audio, you could use the src property to specify an URL of an video resource, or the setContent method to specify a dynamically generated video. Developers might be able to control the play of an video by the play, stop and pause methods.

Example

Player-Sample.png

 <video src="zk.mp4" controls="true" autoplay="true" loop="true" />

Supports HTML5

The video component support HTML 5, like <video>, it includes the properties like autoplay, controls, loop, muted and preload.

Multiple Sources

Most browsers do not support all the video formats,so we could specify multiple source files in different formats for different browsers. For examples:

 <video src="zk.mp4, zk.webm, zk.ogg" />

enableFullScreen

The video component provides a client-side method enableFullScreen() to use full screen mode.

 <video id="player" src="zk.mp4" />
 <button xmlns:w="client" w:onClick="zk.$('$player').enableFullScreen()" />

turnOffLight

The video component provides theater mode, If turnOffLight="true", the whole page will cover by translucent black except <video>. When theater mode is enabled, user can click anywhere on the page except the Video to disable theater mode.

Player-turnOffLight.png

 <video src="zk.mp4" turnOffLight="true" />

currentTime

The video provieds setCurrentTime(double) to decide which part of video to play, the value is seconds.

 <video src="zk.mp4" currentTime="60" />

paused

The video provieds setPaused(boolean) to play or pause the video.

paused="false" is same as invoking play(), paused="true" is same as invoking pause().

 <video src="zk.mp4" paused="true" />

volume

The video component provides setVolume(double) to change the volume, the valid value is between 0.0 to 1.0.

 <video src="zk.mp4" volume="0.5" />

muted

The video component provides setMuted(boolean) to mute the video.

 <video src="zk.mp4" muted="true" />

Supported Events

Name
Event Type
None None

Supported Children

*NONE

Use Cases

Version Description Example Location