Loading clips into a player

J. Landman Gay jacque at hyperactivesw.com
Mon Sep 15 15:18:34 EDT 2014


On 9/15/2014, 7:13 AM, Beat Cornaz wrote:
> I want to have the clip inside a visible player. In that way I have
> more control over how to play the clip. E.g. visibly nudging back a
> bit, changing the play speed, seeing at what time the clip is so I
> can mark it, etc. So I need to load the clip into a player, but not
> from disc, but from inside my stack.

There's no way to play an embedded video in a player object, but there 
is a way to work around it. Delete the imported videos from your stack 
and then load them into custom properties instead. You can store binary 
data in custom properties this way:

  set the cThisMovie of this stack to url ("binfile:" & path/to/file)

When you are ready to play a video, write it to the temp folder. You can 
get a unique temporary file name using the tempName function. Then set 
the player filename to that:

  put tempname() into tFilePath
  put the cThisMovie of this stack into url ("binfile:" & tFilePath)
  set the filename of player 1 to tFilePath

The temp folder content is deleted automatically by the OS during 
routine maintenance, but if you want to remove the file yourself 
immediately after playback you can:

   if there is a file tFilePath then delete file tFilePath

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list