iOS Question [SOLVED] Mediaplayer does not play MP3

Timm Sodtalbers

New Member
Licensed User
Hi!

I tried this, but the MP3 file will not be played:
B4X:
Sub Process_Globals
    Public App As Application
    Public NavControl As NavigationController
    Public MediaPlayer1 As MediaPlayer
    Private Page1 As Page
End Sub

Private Sub Application_Start (Nav As NavigationController)
    NavControl = Nav
    Page1.Initialize("Page1")
    Page1.RootPanel.LoadLayout("Page1")
    NavControl.ShowPage(Page1)
End Sub

Sub Button1_Click
    
    Log( File.Exists( File.DirAssets, "ton1.mp3" ) )  'returns true
    
    MediaPlayer1.Initialize( File.DirAssets, "ton1.mp3", "mp" )
    MediaPlayer1.Play
    
End Sub

The MP3 file is ok, it works with B4A.
I attached an example project.

Does anyone have an idea?

Regards, Timm
 

Attachments

  • mp.zip
    13.4 KB · Views: 60

roumei

Active Member
Licensed User
Your project works here (iOS 14.4.1) and the file is played correctly. Have you checked the volume settings?
 
Upvote 0

Timm Sodtalbers

New Member
Licensed User
Many thanks for your support!
Found it and yes, it was an issue with the volume settings.
I thought I had already checked everything but I had missed something. Beginner's mistake...
 
Upvote 0
Top