Back

CreateVideoView

VideoView creates a VideoView object which allows the program to play video files stored locally on the device and streaming video from remote sources.

app.CreateVideoView( width, height, options ) -> app object - VideoView

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" );
}
    Copy     Copy All       Run      

The following methods are avaiable on the VideoView object:

  Destroy()
  Explode()
  Focus()
  GetAbsHeight() -> number - integer
  GetAbsWidth() -> number - integer
  GetDuration() -> number - float
  GetHeight( options ) -> number - fraction of screen height
  GetLeft( options ) -> number - fraction of screen width
  GetPosition( options ) -> object - { left: fraction of parent width, top: fraction of parent height, right: fraction of parent width, bottom: fraction of parent height }
  GetTop( options ) -> number - fraction of screen height
  GetType() -> string - "VideoView"
  GetVisibility() -> string - "Show" or "Hide" or "Gone"
  GetWidth( options ) -> number - fraction of screen width
  Gone()
  Hide()
  IsEnabled() -> boolean
  IsOverlap( obj, depth ) -> boolean
  IsPlaying() -> boolean
  IsReady() -> boolean
  IsVisible() -> boolean
  Pause()
  Play()
  Release()
  SetFile( file )
  SetScale( x, y )
  Show()
  Stop()
  id -> string - "#id"

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
function( error )
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