native.newVideo audio question

I am building a video app using native.newvideo to load in videos based on menu selections.
I have one video that contains audio and I didn’t see any reference to that in the API. Currently I get no audio, didn’t know if I had to manually set volume or something like that…

 local video = native.newVideo( 0, 0, 1024, 768 )  
 local function videoListener( event )  
 if event.errorCode then  
 native.showAlert( "Error!", event.errorMessage, { "OK" } )  
 end  
 if event.phase == "ended" then  
 director:changeScene( "menu", "crossfade" )  
 end  
 end  
 video:load( "video/b221/video.mp4")  
 video:seek( 0 )  
 video:addEventListener( "video", videoListener )  
 video:play()  
 local function onTap( event )  
 Runtime:removeEventListener( "tap", onTap )  
 director:changeScene( "menu", "crossfade" )  
 end  
 Runtime:addEventListener( "tap", onTap );  

[import]uid: 150370 topic_id: 33026 reply_id: 333026[/import]

I went back because I felt I had to be missing something and I found the audio isMuted property.
video.isMuted = false; didn’t seem to work though is that the proper way to set that property?

[import]uid: 150370 topic_id: 33026 reply_id: 131072[/import]

I went back because I felt I had to be missing something and I found the audio isMuted property.
video.isMuted = false; didn’t seem to work though is that the proper way to set that property?

[import]uid: 150370 topic_id: 33026 reply_id: 131072[/import]

Hello @INNOVATIVE,

What device(s) are you building for and testing on? I just worked up a quick sample app and tested in both iOS 5.11 and iOS 6.0. A video with audio embedded works fine, and its volume is controlled by the device’s master volume (you can’t control a video’s volume manually at this time).

Likewise, I played a streaming .m4a file using “audio.loadStream” and it played simultaneously along with the video’s soundtrack.

So, hard to determine what’s going on in your code. Could be the device, could be something related to the actual video (perhaps it’s corrupted somehow, or has some weird encoding?)

Best regards,
Brent Sorrentino
[import]uid: 9747 topic_id: 33026 reply_id: 131110[/import]

Hey Brent,

Thanks for the reply. I’m on 5.1.1 on a 1st gen ipad.

Just as a general question, by default should I be getting audio if I do not specify isMuted is not implicitly set?

I’ve re-encoded my video just to be sure and it seems fine and has audio when played in video players.
[import]uid: 150370 topic_id: 33026 reply_id: 131126[/import]

Did you try to build Corona’s sample app dealing with native video objects? I based my test app off that. It’s located in your local Corona application directory here:

CoronaSDK > SampleCode > Interface > VideoViewPhysics

Please compile that, install it on your device(s), and see what happens…

Brent [import]uid: 9747 topic_id: 33026 reply_id: 131141[/import]

Hello @INNOVATIVE,

What device(s) are you building for and testing on? I just worked up a quick sample app and tested in both iOS 5.11 and iOS 6.0. A video with audio embedded works fine, and its volume is controlled by the device’s master volume (you can’t control a video’s volume manually at this time).

Likewise, I played a streaming .m4a file using “audio.loadStream” and it played simultaneously along with the video’s soundtrack.

So, hard to determine what’s going on in your code. Could be the device, could be something related to the actual video (perhaps it’s corrupted somehow, or has some weird encoding?)

Best regards,
Brent Sorrentino
[import]uid: 9747 topic_id: 33026 reply_id: 131110[/import]

I’m definitely getting audio on the sample, and it doesn’t look like there is anything code wise that is different.
The only obvious difference Is im playing an mp4 and the example is an m4v.

I’ll play around with some different videos and see if I can come up with anything.

[import]uid: 150370 topic_id: 33026 reply_id: 131149[/import]

Hey Brent,

Thanks for the reply. I’m on 5.1.1 on a 1st gen ipad.

Just as a general question, by default should I be getting audio if I do not specify isMuted is not implicitly set?

I’ve re-encoded my video just to be sure and it seems fine and has audio when played in video players.
[import]uid: 150370 topic_id: 33026 reply_id: 131126[/import]

Did you try to build Corona’s sample app dealing with native video objects? I based my test app off that. It’s located in your local Corona application directory here:

CoronaSDK > SampleCode > Interface > VideoViewPhysics

Please compile that, install it on your device(s), and see what happens…

Brent [import]uid: 9747 topic_id: 33026 reply_id: 131141[/import]

I’m definitely getting audio on the sample, and it doesn’t look like there is anything code wise that is different.
The only obvious difference Is im playing an mp4 and the example is an m4v.

I’ll play around with some different videos and see if I can come up with anything.

[import]uid: 150370 topic_id: 33026 reply_id: 131149[/import]