How can I play a video .mov on storyboard

I read this article

http://www.coronalabs.com/blog/2012/01/24/using-the-new-native-web-video-apis/

but I did not understand it.

I would like to play a movie in storyboard fro my book. I try this but id did not work, do you know why?


I have a function

local function moreWorld()
        local video = native.newVideo (0, 0, 220, 275)
        video:load(“julio.mov”, system.DocumentsDirectory)
        
        video:play()
        video.x = 50
        video.y = 150
        
        video:pause()
        video:removeSelf()
        video = nil    
    return true
end


and a button to make the function work

buttonMore = widget.newButton{
        defaultFile=“buttonMoreRed.png”,
        onRelease = moreWorld
    }
    buttonMore.x = 700
    buttonMore.y = 400


I was hoping that when I press the button the movie will play but it didn’t work.

Thanks for your help on this

Victor

You might want to look at the media.playVideo() API.

http://docs.coronalabs.com/api/library/media/playVideo.html

Thank you Rob. I can play the video now.

I just have the button


buttonMore = widget.newButton{
        defaultFile=“buttonMoreRed.png”,
        onRelease = moreWorld                 ------ Here I tell the button that onRelease, perferm this “moreWorld” function
    }
    buttonMore.x = 700
    buttonMore.y = 400


Then in the function with the name “moreWorld”


local function moreWorld()
        media.playVideo (“julio.mov”, true)     --------- Here I tell the “media” to play the Video (I have the name of the video
    return true                                                --------- and it’s a .mov file, and the “true” means that people can see the
end                                                              --------- video controls.

------------------ IT WORKS! -------------

The only thing I’m missing is that now I have to wait until the video it’s finish.

I don’t see any button to go “back” If people don’t want to see the whole video, they are stuck.

How do I get the “done” button, or the “back” button?

Thanks

Victor

Hi Rob, if you see this.

How can I have a button that says “done” or “back”

when I play a video?

I can play the video right now.

but it only shows play, pause, and fast forward buttons.

But if people don’t want to see the whole video, That’s why I need the “done” or “back” buttons.

I don’t find information in how to do that.

Thanks.

Victor

My app is almost ready!

Hi Rob, or Brent.

Could you please help me out by telling me

How do I get a “done” button in the video playback?

My video plays fine, but people have to watch the complete video before they can do anything

what if they don’t want to watch the whole video?

there is no “done” blue button or “back” button anywhere.

Could you tell me how can I add that to the video player.

Thanks

Victor

You might want to look at the media.playVideo() API.

http://docs.coronalabs.com/api/library/media/playVideo.html

Thank you Rob. I can play the video now.

I just have the button


buttonMore = widget.newButton{
        defaultFile=“buttonMoreRed.png”,
        onRelease = moreWorld                 ------ Here I tell the button that onRelease, perferm this “moreWorld” function
    }
    buttonMore.x = 700
    buttonMore.y = 400


Then in the function with the name “moreWorld”


local function moreWorld()
        media.playVideo (“julio.mov”, true)     --------- Here I tell the “media” to play the Video (I have the name of the video
    return true                                                --------- and it’s a .mov file, and the “true” means that people can see the
end                                                              --------- video controls.

------------------ IT WORKS! -------------

The only thing I’m missing is that now I have to wait until the video it’s finish.

I don’t see any button to go “back” If people don’t want to see the whole video, they are stuck.

How do I get the “done” button, or the “back” button?

Thanks

Victor

Hi Rob, if you see this.

How can I have a button that says “done” or “back”

when I play a video?

I can play the video right now.

but it only shows play, pause, and fast forward buttons.

But if people don’t want to see the whole video, That’s why I need the “done” or “back” buttons.

I don’t find information in how to do that.

Thanks.

Victor

My app is almost ready!

Hi Rob, or Brent.

Could you please help me out by telling me

How do I get a “done” button in the video playback?

My video plays fine, but people have to watch the complete video before they can do anything

what if they don’t want to watch the whole video?

there is no “done” blue button or “back” button anywhere.

Could you tell me how can I add that to the video player.

Thanks

Victor

After loading the video onto my iPad, I start the video and notice the word “Done” in the upper corner of the screen.  It must be part of the native player. 

There’s no need to add a “Done” button.  It does it automatically.

After loading the video onto my iPad, I start the video and notice the word “Done” in the upper corner of the screen.  It must be part of the native player. 

There’s no need to add a “Done” button.  It does it automatically.