I used @stevel05 's sample in my code.
But it not resize
https://www.b4x.com/android/forum/threads/playing-a-video.95095/
i addded full sample in attahment.
Or;
if you have more good player lib.; plase share to us.
But it not resize
https://www.b4x.com/android/forum/threads/playing-a-video.95095/
i addded full sample in attahment.
Or;
if you have more good player lib.; plase share to us.
B4X:
Private Sub Base_Resize (Width As Double, Height As Double)
Log("Base_Resize ")
ScrollPaneX.PrefWidth=Width
ScrollPaneX.PrefHeight=Height
Redraw
CallSub3(mCallBack,mEventName & "_Resize",Width,Height)
End Sub
Private Sub Redraw
'If Ratio<1.1 And Ratio>0.9 Then Ratio=1
If Video.IsInitialized Then
Log("Ratio:"&Ratio)
ScrollPaneX.InnerNode.PrefHeight=ScrollPaneX.PrefHeight*Ratio
ScrollPaneX.InnerNode.PrefWidth=ScrollPaneX.PrefWidth*Ratio
Real_image_Width=ScrollPaneX.InnerNode.PrefWidth
Real_image_Height=ScrollPaneX.InnerNode.PrefHeight
Log("innernodesize:"&Real_image_Width&":"&Real_image_Height)
Video.Pause
'Log("video Redraw"&Real_image_Width&"-"&Real_image_Height)
Dim jo,mv As JavaObject
mv=jo.InitializeNewInstance("javafx.scene.media.MediaView",Array As Object(Video))
Log("V.size:"&(Real_image_Width)&" - "&(Real_image_Height))
mv.RunMethod("setX",Array(0.0))
mv.RunMethod("setY",Array(0.0))
mv.RunMethod("setFitWidth",Array(Real_image_Width))
mv.RunMethod("setFitHeight",Array(Real_image_Height))
Video.Play
Else
ScrollPaneX.InnerNode.PrefHeight=Real_image_Height*Ratio
ScrollPaneX.InnerNode.PrefWidth=Real_image_Width*Ratio
imageViewX.PrefWidth=Real_image_Width*Ratio
imageViewX.PrefHeight=Real_image_Height*Ratio
End If
End Sub