Android Question Looking for an audio streaming control not disappering

valentino s

Active Member
Licensed User
Longtime User
I have an url of an mp3 file.

If I use mediaplayerstream I have to write all the code for a play,pause,stop, slider and so on.

If I use videoview I can add a view.

B4X:
Sub Globals
   Dim vv As VideoView
End Sub

Sub Activity_Create(FirstTime As Boolean)
   ...
   vv.Initialize("vv")
   Activity.AddView(vv, 0, 120, 100%x, 50)
End Sub

...

Sub btn_play(url)
     vv.Stop
     vv.LoadVideo("http",Url)
     vv.Play
     vv.MediaControllerEnabled=True
End Sub

The strange behaviours:

  1. On my samsung 3neo android 4.4.2 it works, and seems to start playing without loading the full mp3 file. But without the play button, the slider and so on. Only a black rectangular area. If I tip inside the area, the controls will appear at the bottom, and disappear after few seconds.
  2. If I put the area at the bottom, I can hear but no controls are available even if I tip inside the area.
I should need a media controller for remote files with buttons always visible. Are there different solutions, or I have to write my own controls and sliders ?

The similar solutions on ios 9.3.1 and ios 7.x works perfectly.
Thanks.

In the screenshot you can view controls, but only for few seconds if I tip on the rectangular area on the top, as defined in addview.
 

Attachments

  • Screenshot_2016-04-25-15-35-42.png
    Screenshot_2016-04-25-15-35-42.png
    223.4 KB · Views: 141

valentino s

Active Member
Licensed User
Longtime User
Sorry, doesn't work properly: I can show the controller at the bottom, the even if it plays the controller show the play button instead of pause button, and the time slider stay on 00:00 and doesn't increase. Then If I click on play the controller will disappear after few seconds.
So, there's another solution ? Thanks
 
Upvote 0
Top