0

I create Looping video.

I want to use function callbacks to another stack.

Here my code :

   start using stack "Widget Project"
   put the duration of player "Player" into tDuration
   put tDuration & ",restartPlayer" into tCall
   set the callbacks of player "Player" to tCall
KemChat
  • 151
  • 3
  • 11

1 Answers1

0

You don't need to use callbacks if you want to execute a script when a movie finishes playing. You can use the playStopped message:

on beforeYouStartPlayingTheMovie
   start using stack "Widget Project"
end beforeYouStartPlayingTheMovie

-- in stack "Widget Project"
on playStopped
  if the id of the target is the id of player "Player" of stack "Your Stack" then
    -- do whatever you want here
  end if
  pass playStopped
end playStopped

Use the playerFinished message on iOS and Android.

Mark
  • 2,380
  • 11
  • 29
  • 49