VideoView creates a VideoView object which allows the program to play video files stored locally on the device and streaming video from remote sources.
Example - Video Stream
function OnStart()
{
lay = app.CreateLayout( "Linear", "FillXY,VCenter" );
app.ShowProgress( "Buffering..." );
player = app.CreateVideoView( 0.9, 0.4 );
player.SetOnReady( player_OnReady );
player.SetOnError( player_OnError );
lay.AddChild( player );
player.SetFile( "rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov" );
app.AddLayout( lay );
}
function player_OnReady()
{
app.HideProgress();
app.ShowPopup( "OnReady" );
player.Play();
}
function player_OnError()
{
app.HideProgress();
app.ShowPopup( "OnError" );
}
The following methods are avaiable on the VideoView object:
GetPosition(
options ) ->
object - { left: fraction of parent width, top: fraction of parent height, right: fraction of parent width, bottom: fraction of parent height }
unknown
number
set color effects
?
destroys object
destroys object with explode animation and sound
?
get height in pixels
get width in pixels
GetDuration in minutes
get screen relative height
get distance to left parent border
get distance to upper parent border
GetVisibility
get screen relative width
Set visibility "Gone"
Set visibility "Hide"
IsEnabled
app object
number - fraction of screen width
return wether obj overlap with an other
returns wether video is currently playing
IsVisible
Pause video
Play video
?
number - integer
SeekTo given time in num_seconds
string -
hexadecimal: "#rrggbb", "#aarrggbb"
colourName: "red", "green", ...
SetBackColor
number - fraction of screen height
SetBackColorRadial
string - path to file or folder ( "/absolute/..." or "relative/..." )
changes the background image
string - "Add" or "Multiply" or "?"
adjust color
boolean
en/disable object
SetFile
move object from current position
function()
? called when
called when an error appeared
function()
called when playing video finished
set surrounding borders
SetPosition
number - factor
SetScale
change object size
string - "Show" or "Hide" or "Gone"
change visibility mode
number - percent
SetVolume
Set visibility "Show"
Stop video
?
object id