Android Question Files in File.DirAssets cann't accept Thai song as non-English file name.

Theera

Well-Known Member
Licensed User
Longtime User
Hi all,
I need to add Thai song in File.DirAsset by press the button "add"
It 's not accepted as Thai language. I must always rename the files in English before. Is there way make it accepted Thai language or non-English?

Best Regards
Theera
 

PaulMeuris

Active Member
Licensed User
You can't add files in code to the DirAssets folder because it is read-only as you probably already know.
In the B4A IDE you can add a file in the Files Manager that has a Thai name.
1701344586699.png
1701344617604.png


B4X:
    Dim lst As List = File.ListFiles(File.DirAssets)
    Log(lst.Get(lst.Size-1))
In my case the file with the Thai name is the last file from the list.
 
Upvote 0

Theera

Well-Known Member
Licensed User
Longtime User
In exoplayer example,I have tried to add Thai song ,but I can't be accepted. Please try again.

B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    player1.Initialize("player")
    Dim sources As List
    sources.Initialize
'    sources.Add(player1.CreateUriSource("http://vod.tuxchannel.tv/peliculas/720/late%20night%202019.mkv"))
'    sources.Add(player1.CreateUriSource("http://vod.tuxchannel.tv/peliculas/720/late%20night%202019.mkv"))
'    sources.Add(player1.CreateUriSource("http://vod.tuxchannel.tv/peliculas/720/late%20night%202019.mkv"))
    sources.Add(player1.CreateFileSource(File.DirAssets,"ThanksForLovingMe.mp3")) '<==It is accepted only English song
    sources.Add(player1.CreateFileSource(File.DirAssets,"ขอบคุณที่ยังรักกัน.mp3"))  '<==It can't be accepted Thai song
    player1.Prepare(player1.CreateListSource(sources))
    SimpleExoPlayerView1.Player = player1
SimpleExoPlayerView1.As(JavaObject).RunMethod("setShutterBackgroundColor", Array(0xfff3a6c0))
SimpleExoPlayerView1.Color = 0xfff3a6c0
End Sub
 
Upvote 0

PaulMeuris

Active Member
Licensed User
I have done some tests with the exoplayer library and the code below:
B4X:
Sub Process_Globals
    Private xui As XUI
    Private player1 As SimpleExoPlayer
End Sub
Sub Globals
    Public sources As List
    Private SimpleExoPlayerView1 As SimpleExoPlayerView
End Sub
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("Layout")
    player1.Initialize("player1")
End Sub
Sub Activity_Resume
    sources.Initialize
    sources.Add(player1.CreateFileSource(File.DirAssets,"บทสวดยอดพระกัณฑ์ไตรปิฎก.mp4"))
    player1.Prepare(player1.CreateListSource(sources))
    SimpleExoPlayerView1.Player = player1
    player1.Play
End Sub
I have added the SimpleExoPlayerView1 in the designer.
In debug mode this code works.
1701518074119.png

BUT, in release mode the filename seems to be causing some problems in the linker.
1701518257230.png

In debug mode.
1701518629863.png

This needs to be fixed by Erel.
Note: in B4A version 12.50 this happens also.
 
Last edited:
Upvote 0
Top