B4J Library MediaView library

B4X:
Sub Process_Globals
    Private fx As JFX
    Private MainForm As Form
    Dim mp As MediaPlayer
    Dim mv As MediaView
    Dim msgbox As Msgboxes
End Sub

Sub AppStart (Form1 As Form, Args() As String)
    msgbox.Show("put test.mp4 beside me(under objects)","info")
    MainForm = Form1
    MainForm.Title="play mp4 video"
    MainForm.SetFormStyle("UNDECORATED")'no win title
    MainForm.WindowLeft=0
    MainForm.WindowTop=0
    MainForm.WindowHeight=fx.PrimaryScreen.MaxY
    MainForm.WindowWidth=fx.PrimaryScreen.MaxX
    mp.Initialize("mp",File.geturi(File.DirApp,"test.mp4"))
    mv.init("mv",MainForm.RootPane,mp)
    MainForm.Show
End Sub
Sub mv_onready
    Dim videowidth,videoheight As Double
    videowidth=mv.MediaInfo.width
    videoheight=mv.MediaInfo.height
    Log("media size:"&videoheight&"-"&videowidth)
    mv.FitHeight=videoheight
    mv.FitWidth=videowidth
    mp.Play
End Sub
Sub mp_Complete
    msgbox.Show("play completed!","Tips")
End Sub
 

Attachments

  • MediaView_B4JLibs.zip
    4.9 KB · Views: 1,265

maleche

Active Member
Licensed User
Longtime User
any documentation for this? works nice on my machine but, how can I load another video without using RemoveRootAt command. I am using the Complete event to load the next video, but I think it makes another instance instead of deleting older video or embedding the current one in the existing module.
Thanks!
 

marco.canta

Active Member
Licensed User
Longtime User
Is possible insert mediaview in a Pane ?
and possible more Pane with more mediaview ?

Thanks
Marco
 

cirollo

Active Member
Licensed User
Longtime User
Is possible insert mediaview in a Pane ?
and possible more Pane with more mediaview ?

Thanks
Marco

need too!
I should show a logo beetween the movies....

movie1 >> pause of 5 sec and logo show >> movie 2......

how can I do it since media viewer is not a custo view??

regards,
cirollo
 

techknight

Well-Known Member
Licensed User
Longtime User
This library isnt working with Panes. the javaobject version does.

java.lang.ClassCastException: anywheresoftware.b4j.objects.PaneWrapper$ConcretePaneWrapper$NonResizePane cannot be cast to javafx.scene.layout.AnchorPane

Since I havent seen any updates from this thread, I guess the library is abandoned at this point and should not be used.
 

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
Hello icefairy333,

I'm using your sample with this library, but the FitHeight and FitWidth is not work, is taking entire sizes...

Also I tried to put the sizes of my form and still not working, like this:

objMV.FitHeight=MainForm.Height
objMV.FitWidth=MainForm.Width

is oversizing the form....

Do you have any sample with this working? and if the mainform is resizing, how to fit the video again? I'm using MediaView 1.00

Thank you
Alberto Iglesias
 
Top