Android Question VideoView Volume Control Problem

biometrics

Active Member
Licensed User
Longtime User
I need to control the volume of two videoviews to cross fade the audio when the one stops playing (fading out/volume going to silent) and the other starts playing (fading in/volume going to maximum). I can't use the phone volume control as that is global.

I use the code Erel posted here: https://www.b4x.com/android/forum/threads/mute-audio-in-videoview.39122/#post-232208


We use this Android 4.4 device as a media player for digital signage: http://giadatech.com/pshow-65.html





I was using a monitor with DVI input and a HDMI to DVI cable when I was developing the code. I was listening to the sound with headphones via the 3.5mm earphone port. It was working well.

I am now testing using a monitor with HDMI input and a HDMI to HDMI cable. This monitor has speakers so I'm not using the 3.5 mm earphone port. The code is failing now.

The following code from Erel's example is repeating and never gets past the If statement:

B4X:
If r1.Target = Null Then
    CallSubDelayed2(Me, "MuteVideo", vv)
    Return
End If

Any assistance will be greatly appreciated.
 

biometrics

Active Member
Licensed User
Longtime User
Turns out you can't set the VideoView volume if it's set to invisible.

Might still convert to ExoPlayer but I'll see if this works tomorrow at the office.
 
Upvote 0

biometrics

Active Member
Licensed User
Longtime User
Ok, I give up on setting the volume on a VideoView, it's just not reliable. ExoPlayer here I come ...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…