Hello,
I have a sports app with a "Radio" icon that play an audio stream from shoutcheap:
I was using AVplayer and everything was working fine until some weeks ago (not sure how long). Is not working in any iOS device, but the code didn't change (I actually didn't upgrade de app)
The code is working fine and most of it just makes a "loading" effect in the icon.
The problem is specifically with the line:
There are no errors and playerstatus is actually 1 (Ready to play)
But nothing happens. No sound comming out. Seems like is playing but no sound.
As I said this as been tested in many devices.
The streaming works fine and I tested several streamings.
Wondering if is something related with iOS/AVPlayer that recentrly changed? Any ideas?
Part of the code I'm using for this:
I have a sports app with a "Radio" icon that play an audio stream from shoutcheap:
I was using AVplayer and everything was working fine until some weeks ago (not sure how long). Is not working in any iOS device, but the code didn't change (I actually didn't upgrade de app)
The code is working fine and most of it just makes a "loading" effect in the icon.
The problem is specifically with the line:
B4X:
Player1.RunMethod("play", Null)
There are no errors and playerstatus is actually 1 (Ready to play)
But nothing happens. No sound comming out. Seems like is playing but no sound.
As I said this as been tested in many devices.
The streaming works fine and I tested several streamings.
Wondering if is something related with iOS/AVPlayer that recentrly changed? Any ideas?
Part of the code I'm using for this:
B4X:
Sub Process_Globals
Dim Player1 As NativeObject
Dim PlayerStatus As Int '1 = Ready 0 = Error
Dim PlayerControl As Int '1 = IsPlaying 0 = Is Paused
End Sub
Private Sub ImageIconoRadio_Click
If PlayerControl = 0 Then
StartStreaming
Else
StopStreaming
End If
End Sub
Private Sub StartStreaming
ImageIconoRadio.Bitmap = LoadBitmap(File.DirAssets,"radio-load0.png")
LabelRadio.TextColor = Colors.White
Player1 = CreatePlayer("https://cp3.shoutcheap.com:18019/stream")
ContadorPlayer = 0
ContadorPlayerSeguridad = 0
Timer3.Enabled = True
End Sub
Sub Timer3_Tick
Timer3.Enabled=False
If ContadorPlayer = 0 Then
ImageIconoRadio.Bitmap = LoadBitmap(File.DirAssets,"radio-load0.png")
ContadorPlayer = 1
Else If ContadorPlayer = 1 Then
ImageIconoRadio.Bitmap = LoadBitmap(File.DirAssets,"radio-load1.png")
ContadorPlayer = 2
Else If ContadorPlayer = 2 Then
ImageIconoRadio.Bitmap = LoadBitmap(File.DirAssets,"radio-load2.png")
ContadorPlayer = 3
Else If ContadorPlayer = 3 Then
ImageIconoRadio.Bitmap = LoadBitmap(File.DirAssets,"radio-load3.png")
ContadorPlayer = 0
End If
ContadorPlayerSeguridad = ContadorPlayerSeguridad + 1
If ContadorPlayerSeguridad = 50 Then
StopStreaming
Else
Timer3.Enabled=True
End If
PlayerStatus = Player1.GetField("status").AsNumber
Log(PlayerStatus)
If PlayerStatus = 1 And ContadorPlayerSeguridad > 5 Then
Player1.RunMethod("play", Null)
PlayerControl = 1
Timer3.Enabled = False
ImageIconoRadio.Bitmap = LoadBitmap(File.DirAssets,"iconoradio2selected.png")
ContadorPlayer = 0
End If
End Sub
Last edited: