have a PC with a shared folder and within this an mp3 file.
How do I use MediaPlayerStream to load the file?
I've tried with m.load ("http: //Nombrepc/folder/file.mp3")
or m.load ("http://192.168.1.6/folder/file.mp3")
It does not work for me any ideas?
Android 7.1
Thanks
How do I use MediaPlayerStream to load the file?
I've tried with m.load ("http: //Nombrepc/folder/file.mp3")
or m.load ("http://192.168.1.6/folder/file.mp3")
It does not work for me any ideas?
Android 7.1
B4X:
Region Project Attributes
#ApplicationLabel: DLNA
#VersionCode: 1
#VersionName:
'SupportedOrientations possible values: unspecified, landscape or portrait.
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: False
#BridgeLogger: True
#End Region
#Region Activity Attributes
#FullScreen: False
#IncludeTitle: True
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Dim media As MediaPlayerStream
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
End Sub
Sub Activity_Create(FirstTime As Boolean)
'Do not forget to load the layout file created with the visual designer. For example:
'Activity.LoadLayout("Layout1")
media.Initialize("media")
media.Load("http://192.168.1.6/PlayAudioFile/SoundSample.mp3")
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
End Sub
Sub media_StreamReady
Log("media")
media.play
End Sub
Sub media_StreamError (ErrorCode As String, ExtraData As Int)
Log("Error: " & ErrorCode & ", " & ExtraData)
ToastMessageShow("Error: " & ErrorCode & ", " & ExtraData, True)
End Sub
Sub media_StreamBuffer(Percentage As Int)
Log(Percentage)
End Sub
Last edited: