Module: siteKiosk.ui.views.video

A module representing a video view. The video view itself inherits most of its methods from View. It also adds some video related functions. The most important ones are:
  • getIsPlaying - determine wether or not the video is playing
  • getPath - determine the video's source path
  • pause - pauses the video
  • play - starts video playback
  • resume - resumes video playback
  • seekTo - seeks to the specified time in the video
There are several video related events that you can attach a listener to:
  • onPreloaded - register a callback which is triggered when the video finished preloading
  • onCompleted - register a callback which is triggered when playback has finished
  • onError - register a callback which is triggered when the video loading fails


For an example of the videoView please have a look at the VideoViewApp sample from the SiteKiosk Android samples.

new siteKiosk.ui.views.video(params)

Creates a video view.
Parameters:
Name Type Description
params * The video views params
Properties
Name Type Argument Default Description
width number <optional>
100 The view's width
height number <optional>
100 The view's height
left number <optional>
0 The view's left anchor
top number <optional>
0 The view's top anchor
useRelative boolean <optional>
true
clipRect * <optional>
undefined The view's clip rect
zIndex number <optional>
0 The view's z-index
rightMargin number <optional>
0 The view's right margin
bottomMargin number <optional>
0 The view's bottom margin
visibility string <optional>
"visible" The view's visibility

Members

<readonly> id :number

The view's ID.
Type:
  • number
Inherited From:

<readonly> isView :boolean

Identifies a view.
Type:
  • boolean
Inherited From:

Methods

activate()

Activates the view
Inherited From:

allowLayoutUpdates()

Enables updating the layout, when a property changes.
Inherited From:

center()

Centers the view in the middle of the screen.
Inherited From:

close()

Closes the video view.

focus()

Focus the views
Inherited From:

getCanMaximize() → {boolean}

Gets whether the view can be maximized
Inherited From:
Returns:
The state.
Type
boolean

getCanMinimize() → {boolean}

Gets whether the view can be minimized
Inherited From:
Returns:
The state.
Type
boolean

getCanSeekBackward() → {boolean}

Gets whether the video supports seeking backward.
Returns:
Whether the video supports seeking backward
Type
boolean

getCanSeekForward() → {boolean}

Gets whether the video supports seeking forward.
Returns:
Whether the video supports seeking forward
Type
boolean

getClipRect() → {*}

Gets the view's clip rect.
Inherited From:
Returns:
The view's clip rect
Type
*

getHeight() → {number}

Gets the view's height.
Inherited From:
Returns:
The view's height
Type
number

getHideWhenClose() → {boolean}

Gets whether the view is will hide when the user tries to close it.
Inherited From:
Returns:
The state.
Type
boolean

getIsCloseable() → {boolean}

Gets whether the view is closeable,
Inherited From:
Returns:
The closeability.
Type
boolean

getIsPlaying() → {boolean}

Gets whether the video is playing.
Returns:
True, if the video is playing
Type
boolean

getLeft() → {number}

Returns the left anchor.
Inherited From:
Returns:
The left ancor
Type
number

getName() → {string}

Gets the view's name.
Inherited From:
Returns:
The view's name
Type
string

getOpacity() → {number}

Gets the view's opacity.
Inherited From:
Returns:
The view's opacity
Type
number

getParent() → {number}

Gets the view's parent.
Inherited From:
Returns:
value The parent's view id
Type
number

getPath() → {string}

Gets the path to the video source.
Returns:
The path to the video source
Type
string

getRelativeClipRect() → {*}

Gets the view's relative clip rect.
Inherited From:
Returns:
The view's relative clip rect
Type
*

getRelativeLeft() → {number}

Gets the relative left anchor.
Inherited From:
Returns:
The relative left anchor
Type
number

getRelativeTop() → {number}

Gets the relative top anchor.
Inherited From:
Returns:
The relative top anchor
Type
number

getRoot() → {View}

Gets the view's root.
Inherited From:
Returns:
value The root's view
Type
View

getTitle() → {string}

Getsthe title of this view.
Inherited From:
Returns:
The title.
Type
string

getTop() → {number}

Returns the top anchor.
Inherited From:
Returns:
the top anchor
Type
number

getTopMost() → {boolean}

Gets if the view is top most.
Inherited From:
Returns:
Is the view top most.
Type
boolean

getUseFixedSize() → {boolean}

Gets whether the video view is being displayed in fixed size.
Returns:
Whether the video view is being displayed in fixed size
Type
boolean

getVideoHeight(value)

Gets the video height.
Parameters:
Name Type Description
value number The video views height

getVideoWidth() → {number}

Gets the video width.
Returns:
The video views width
Type
number

getVisibility() → {string}

Gets the view's visibility.
Inherited From:
Returns:
The view's visibility
Type
string

getWidth() → {number}

Gets the view's width.
Inherited From:
Returns:
The view's width
Type
number

getZIndex() → {number}

Gets the view's z-index.
Inherited From:
Returns:
The view's z-index
Type
number

invalidate()

Forces a redraw.
Inherited From:

onActivated(callback) → {siteKiosk.ui.view~eventSubscription}

Registers a callback, which will be triggered when a view is activated
Parameters:
Name Type Description
callback siteKiosk.ui.view~activatedCallback The callback, which will be triggered when a view is activated
Inherited From:
Returns:
An handler to unsubscribe the event
Type
siteKiosk.ui.view~eventSubscription

onClosed(callback) → {siteKiosk.ui.view~eventSubscription}

Registers a callback, which will be triggered when a view is closed
Parameters:
Name Type Description
callback siteKiosk.ui.view~closedCallback The callback, which will be triggered when a view is closed
Inherited From:
Returns:
An handler to unsubscribe the event
Type
siteKiosk.ui.view~eventSubscription

onCompleted(callback) → {siteKiosk.ui.views.video~eventSubscription}

Registers a callback, which will be triggered when the playback has finsihed.
Parameters:
Name Type Description
callback siteKiosk.ui.views.video~completedCallback The callback, which will be triggered when the playback has finsihed
Returns:
Type
siteKiosk.ui.views.video~eventSubscription

onDeactivated(callback) → {siteKiosk.ui.view~eventSubscription}

Registers a callback, which will be triggered when a view is deactivated
Parameters:
Name Type Description
callback siteKiosk.ui.view~deactivatedCallback The callback, which will be triggered when a view is deactivated
Inherited From:
Returns:
An handler to unsubscribe the event
Type
siteKiosk.ui.view~eventSubscription

onError(callback) → {siteKiosk.ui.views.video~eventSubscription}

Registers a callback, which will be triggered when the video load results in an error.
Parameters:
Name Type Description
callback siteKiosk.ui.views.video~errorCallback The callback, which will be triggered when the video load results in an error
Returns:
Type
siteKiosk.ui.views.video~eventSubscription

onGotFocus(callback) → {siteKiosk.ui.view~eventSubscription}

Registers a callback, which will be triggered when a view receives the focus.
Parameters:
Name Type Description
callback siteKiosk.ui.view~gotFocusCallback The callback, which will be triggered when a view receives the focus
Inherited From:
Returns:
An handler to unsubscribe the event
Type
siteKiosk.ui.view~eventSubscription

onPreloaded(callback) → {siteKiosk.ui.views.video~eventSubscription}

Registers a callback, which will be triggered when the video is preloaded.
Parameters:
Name Type Description
callback siteKiosk.ui.views.video~preloadedCallback The callback, which will be triggered when the video is preloaded
Returns:
Type
siteKiosk.ui.views.video~eventSubscription

pause()

Pauses video playback.

play()

Starts video playback.

preventLayoutUpdates()

Prevents layout changes from happening.
Inherited From:

resume()

Resumes video playback.

seekTo(msec)

Seeks to the specified time in milliseconds.
Parameters:
Name Type Description
msec number The time position in milliseconds to seek to

setCanMaximize(The)

Sets whether the view can be maximized
Parameters:
Name Type Description
The boolean state.
Inherited From:

setCanMinimize(The)

Sets whether the view can be minimized
Parameters:
Name Type Description
The boolean state.
Inherited From:

setClipRect(value)

Sets the view's clip rect.
Parameters:
Name Type Description
value * The view's clip rect
Inherited From:

setHeight(value)

Sets the view's height.
Parameters:
Name Type Description
value number The view's height
Inherited From:

setHideWhenClose(The)

Sets whether the view is will hide when the user tries to close it.
Parameters:
Name Type Description
The boolean state.
Inherited From:

setIsCloseable(The)

Sets whether the view is closeable,
Parameters:
Name Type Description
The boolean closeability.
Inherited From:

setLeft(value)

Sets the left anchor.
Parameters:
Name Type Description
value number The left anchor
Inherited From:

setMaxSize(width, height)

Sets the view's maxSize.
Parameters:
Name Type Description
width number The view's maxWidth
height number The view's maxHeight
Inherited From:

setMinSize(width, height)

Sets the view's minSize.
Parameters:
Name Type Description
width number The view's minWidth
height number The view's minHeight
Inherited From:

setName()

Sets the view's name.
Inherited From:

setOpacity(value)

Sets the view's opacity.
Parameters:
Name Type Description
value number The view's opacity
Inherited From:

setParent(value)

Sets the view's parent.
Parameters:
Name Type Description
value number The parent's view id
Inherited From:

setPath(value)

Sets the path to the video source.
Parameters:
Name Type Description
value string The path to the video source

setPosition(left, top, isRelativePosition)

Sets the view's position.
Parameters:
Name Type Description
left number The view's left position
top number The view's top position
isRelativePosition bool Are the coordinates relative to the view´s parent.
Inherited From:

setPositionAndSize(left, top, width, height, isRelativePosition)

Sets the view's position and size.
Parameters:
Name Type Description
left number The view's left position
top number The view's top position
width number The view's width
height number The view's height
isRelativePosition bool Are the coordinates relative to the view´s parent.
Inherited From:

setRelativeClipRect(value)

Sets the view's relative clip rect.
Parameters:
Name Type Description
value * The view's relative clip rect
Inherited From:

setRelativeLeft(value)

Sets the relative left anchor.
Parameters:
Name Type Description
value number The relative left anchor
Inherited From:

setRelativeTop(value)

Sets the relative top anchor.
Parameters:
Name Type Description
value number The relative left anchor
Inherited From:

setSize(width, height)

Sets the view's size.
Parameters:
Name Type Description
width number The view's width
height number The view's height
Inherited From:

setTitle(The)

Sets the view title
Parameters:
Name Type Description
The string title.
Inherited From:

setTop(value)

Sets the top anchor.
Parameters:
Name Type Description
value number The top anchor
Inherited From:

setTopMost(value)

Sets if thew view is top most.
Parameters:
Name Type Description
value boolean Should the view be top most.
Inherited From:

setUseFixedSize(value)

Sets whether the video view should displayed in fixed size.
Parameters:
Name Type Description
value Whether the video view should be displayed in fixed size

setVisibility(value)

Sets the view's visibility.
Parameters:
Name Type Description
value string The view's visibility
Inherited From:

setWidth(value)

Sets the view's width.
Parameters:
Name Type Description
value number The view's width
Inherited From:

setZIndex(value)

Sets the view's z-index.
Parameters:
Name Type Description
value number The view's z-index
Inherited From:

stop()

Stops video playback.

Type Definitions

completedCallback()

This callback will be triggered when the playback has finsihed.

errorCallback()

This callback will be triggered when the video load results in an error.

eventSubscription

An event subscription.
Type:
  • Object
Properties:
Name Type Description
unbind function Unsubscribes the event

preloadedCallback()

This callback will be triggered when the video is preloaded.