Android Question MediaBrowser does not generate Thumbfile.

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi,

I am trying to generate thumbfile of a video on my tablet having android 5.0.1 it says "No media on the device." The media video file is present and it is running also.

m=mb.GetExtVideoFileInfo(File.DirRootExternal & "/SVPS/" & sSelectedFile)
bmp = mb.GetVideoThumbnailByID(m.Get("ID0"),True)

I doubt in Activity_Create i have initialized mb as
If FirstTime Then mb.Initialize("")
and the above code in written in Activity_Resume so i initialize it again in Activity_Resume it didnt work. I removed the intialize statement even that didn't work.

What could be wrong?

Pls guide me.

Juzer
 

Informatix

Expert
Licensed User
Longtime User
Hi,

I am trying to generate thumbfile of a video on my tablet having android 5.0.1 it says "No media on the device." The media video file is present and it is running also.

m=mb.GetExtVideoFileInfo(File.DirRootExternal & "/SVPS/" & sSelectedFile)
bmp = mb.GetVideoThumbnailByID(m.Get("ID0"),True)

I doubt in Activity_Create i have initialized mb as
If FirstTime Then mb.Initialize("")
and the above code in written in Activity_Resume so i initialize it again in Activity_Resume it didnt work. I removed the intialize statement even that didn't work.

What could be wrong?

Pls guide me.

Juzer
Are you sure that the system has registered your video file in its database? To be sure, reboot your device.
 
Upvote 0

Juzer Hussain

Active Member
Licensed User
Longtime User
Hi Erel,

"I just tried initializing MediaBrowser in resume i removed it already."
I am seeing the video file it is running also but its not detected by MediaBrowser in the statement below.

m=mb.GetExtVideoFileInfo(File.DirRootExternal & "/SVPS/" & sSelectedFile)

I am getting follwing error in log-:

MediaBrowser: no media on the device!
DecorView setVisiblity: visibility = 0 ,Parent =ViewRoot{2fed7438 com.svps/com.svps.frmselectclass,ident = 6}, this =com.android.internal.policy.impl.PhoneWindow$DecorView{29894f6d V.E..... R.....ID 0,0-479,96}
Broadcast sticky: Intent { act=android.intent.action.SIG_STR flg=0x20000010 (has extras) } ordered=false userid=-1 callerApp=ProcessRecord{125502d2 625:system/1000}
[FrameBufferSurface_0](this:0xb8bc7998,id:0,api:1,p:136,c:136) queueBuffer: fps=63.40 dur=1009.54 max=16.40 min=14.64
[Built-in Screen (type:0)] fps:63.394997,dur:1009.54,max:16.41,min:14.63
TRAFFIC_STATS_POLL true Token 593 num clients 8
packet count Tx=94729 Rx=77056
[com.svps/com.svps.frmselectclass](this:0xb8be36d8,id:2364,api:1,p:10406,c:136) queueBuffer: fps=62.40 dur=1009.63 max=33.80 min=11.07
[FrameBufferSurface_0](this:0xb8bc7998,id:0,api:1,p:136,c:136) queueBuffer: fps=63.38 dur=1009.72 max=16.33 min=15.27
[Built-in Screen (type:0)] fps:63.383434,dur:1009.73,max:16.35,min:15.27
TRAFFIC_STATS_POLL true Token 593 num clients 8
packet count Tx=94729 Rx=77056
ConnectedState (when=-2ms what=131155 arg1=98!CMD_RSSI_POLL 98 0 "AndroidAP" e8:cd:2d:84:ed:69 rssi=-39 f=2412 sc=60 link=65 tx=1.4, 0.0, 0.0 rx=1.4 bcn=0 [on:0 tx:0 rx:0 period:3001] from screen [on:0 period:-2053371197] gl hn u24 rssi=-34 ag=0 hr ticks 0,0,0 ls-=0 [56,56,56,56,61] brc=0 lrc=0

Thanks
Juzer
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
I'm using the MediaBrowser and renaming the file in my program.
When I use the ScanNewMedia function, the renamed file does not appear.
B4X:
Sub ScanMedia(FolderName As String, FileName As String)
    Dim Folders() As String
    Folders = Array As String(File.Combine(FolderName, FileName))
    MB.ScanNewMedia(Folders)
End Sub
I've also tried sending it only the foldername; foldername and "" for filename; "" for foldername; and file.dirrootexternal & "/DCIM/Camera" with all the mentioned iterations.
All with no results.
Any advice will be appreciated.
Rusty
 
Upvote 0

Informatix

Expert
Licensed User
Longtime User
I'm using the MediaBrowser and renaming the file in my program.
When I use the ScanNewMedia function, the renamed file does not appear.
B4X:
Sub ScanMedia(FolderName As String, FileName As String)
    Dim Folders() As String
    Folders = Array As String(File.Combine(FolderName, FileName))
    MB.ScanNewMedia(Folders)
End Sub
I've also tried sending it only the foldername; foldername and "" for filename; "" for foldername; and file.dirrootexternal & "/DCIM/Camera" with all the mentioned iterations.
All with no results.
Any advice will be appreciated.
Rusty
I tried the function and it works fine, but it seems there's a delay to record the new name in the media database and thus the change cannot be immediately seen.
When you log File.Combine(FolderName, FileName), is it correct? No problem with upper/lower case?
Note that DCIM/Camera is a folder where you're not supposed to make changes yourself.
 
Upvote 0

Rusty

Well-Known Member
Licensed User
Longtime User
Thanks Fred,
Yes, it is the correct folder/filename in the log.
How should one properly rename a file within the DCIM/Camera folder?
Thanks,
Rusty
 
Upvote 0
Top