Android Question Why not show GIFs and Videos use the [B4X]SimpleMediaManager (SMM)

winjiadh

Active Member
Licensed User
Longtime User
I downloaded the example of the forum,SMM_Example1.zip
B4X:
Private Sub B4XPage_Created (Root1 As B4XView)
    Root = Root1
    Root.LoadLayout("MainPage")
    MediaManager.Initialize
    MediaManager.SetMedia(Pane1, "https://b4x-4c17.kxcdn.com/android/forum/data/avatars/o/102/102342.jpg?1496491953")
    
    Dim extra As Map = CreateMap(MediaManager.REQUEST_ROUNDIMAGE: True, MediaManager.REQUEST_BACKGROUND: xui.Color_Yellow)
    MediaManager.SetMediaWithExtra(Pane2, "https://b4x-4c17.kxcdn.com/android/forum/data/avatars/o/102/102342.jpg?1496491953", "", extra)
    'for this one you need to add SMM_GIF to the build configuration (Ctrl + B) and add a reference to B4XGifView
    MediaManager.SetMedia(Pane4, "https://www.b4x.com/android/forum/attachments/anywhere-sw-gif.87363/")
    MediaManager.SetMedia(Pane3, "https://player.vimeo.com/external/354886143.hd.mp4?s=2e182d1b22282a63a9533ffda5bb0b2295cdb8e6&profile_id=175")
    #if SMM_GIF
    MediaManager.SetMedia(Pane4, "https://www.b4x.com/android/forum/attachments/anywhere-sw-gif.87363/")
    #End If
    'and for this one you need to add SMM_VIDEO to the build configuration (Ctrl + B) and add a reference to: B4J - MediaView, B4i - iUI8, B4A - ExoPlayer
    #if SMM_VIDEO
    MediaManager.SetMedia(Pane3, "https://player.vimeo.com/external/354886143.hd.mp4?s=2e182d1b22282a63a9533ffda5bb0b2295cdb8e6&profile_id=175")
    #End If
End Sub
GIF and Video cannot be displayed
20230524111121.jpg
ttt20230524111233.jpg
 
Solution
Please don't post large images. Difficult to read your question.

Press Ctrl + B and add the required symbols: SMM_VIDEO and SMM_GIF

1684909856890.png

winjiadh

Active Member
Licensed User
Longtime User
I guess if it can't simply tick B4XGifView and ExoPlayer two libraries, and you also need to do the corresponding setting code, but I can't write, who can kindly help me, thank you!
 
Upvote 0
Top