Author Topic: How do i apply "video_playing "?  (Read 5881 times)

zeroid

  • Full Member
  • ***
  • Posts: 30
    • View Profile
How do i apply "video_playing "?
« on: May 31, 2015, 08:09:15 AM »
Hi.
I've added the video into fe.
now it's playing.
I wanted it to continue do something else or play the next video after the first video was loaded.
How can i do this?
i had tried to make use of "video_playing " but it doesnt work and throws error.


Quote
local intro = fe.add_image("video.mp4", 0, 0, lw, lh);
      intro.video_flags = Vid.NoLoop;
      while(intro.video_playing())
      {
         //trying to show if the video is playing or not
         print(intro.video_playing() + "\n");
      }

the above code throws an error "An error has occured [attempt to call 'bool']".
Any ideas?

checkist

  • Jr. Member
  • **
  • Posts: 22
    • View Profile
Re: How do i apply "video_playing "?
« Reply #1 on: May 31, 2015, 08:56:06 AM »
If something is 'function', parentheses () are added. For example, fe.add_image()
If something is 'variable', no parentheses are added.

In this case, 'video_playing' is variable.

While not so obvious, error message "An error has occured [attempt to call 'bool']", also indicates that
(1) video_playing is 'bool' (bool is a kind of variable)
(2) but is specified in code as function, video_playing(), therefore error occured


Correct syntax would be:

local intro = fe.add_image("video.mp4", 0, 0, lw, lh);
      intro.video_flags = Vid.NoLoop;
      while(intro.video_playing)
      {
         //trying to show if the video is playing or not
         print(intro.video_playing + "\n");
      }


zeroid

  • Full Member
  • ***
  • Posts: 30
    • View Profile
Re: How do i apply "video_playing "?
« Reply #2 on: June 01, 2015, 03:34:17 AM »
Thank you very much.