B4A Library Video Player with Full Screen Option Native

top.png



VideoPlayerFullScreen - Native Video Player with Full Screen Button

reference300.png


VideoPlayerFullScreen
Author:
Alberto Iglesias - [email protected]
Version: 1.0.0


    • Fields:
      • DebugMode As boolean
    • Methods:
      • Version As String
      • Author As String
    • VideoPlayerFullScreen
      Events:
      • onInitialized ()
      • onStarting ()
      • onReset ()
      • onState (State as Int)
    • Methods:
      • IsInitialized As boolean
      • Initialize (EventName As String)
      • URL (URL As String, Title As String)
      • BackPress As Boolean
      • BringToFront
      • Reset
      • gotoScreenFullscreen
      • gotoScreenNormal
      • DebugMode (bDebug As Boolean)
      • AutoFullScreen (ScreenType As float)
      • Play
      • ThumbnailImage (bm As Bitmap)
      • ReleaseAllVideos
      • RequestFocus As boolean
    • Properties:
      • Left As int
      • Background As android.graphics.drawable.Drawable
      • Parent As java.lang.Object [read only]
      • Color As int [write only]
      • Enabled As boolean
      • Top As int
      • State As int [read only]
      • Visible As boolean
      • Height As int
      • Tag As Object
      • Width As int

sample1_2.gif



screen1.jpg





screenshot.png



You can get the library without *DEMO* in our library store:

upload_2019-7-18_0-12-29.png
 

Attachments

  • VideoPlayerFullScreen.zip
    87.8 KB · Views: 974
  • Sample1.zip
    280.9 KB · Views: 921
  • Sample2.zip
    231.1 KB · Views: 817
Last edited:

Alberto Iglesias

Well-Known Member
Licensed User
Longtime User
On dirassets you can't play, try like this:

First, copy the video to your project

1586692688263.png


and then

B4X:
    If File.Exists(File.DirAssets,"corona.mp4") Then
        File.Copy(File.DirAssets,"corona.mp4",File.DirInternal,"corona.mp4" )
    End If
 
    Dim strVideo As String = File.DirInternal & "/corona.mp4"
  
    VideoPlayerFullScreen1.URL(strVideo,"My Video")
 
Last edited:

josefmowarakawa

New Member
i wanted to play portrait full screen but it couldn help so i found an other way i resize videoin after affect or Wondershare Filmora9 i mean i change the size to portrait instead of 1280*720 i resiza it to 720*1280 it will work perfect any way thank u so much
 
When i click on Full Screen, app is going to close
Error:
Logger connected to:  Xiaomi Redmi 3S
--------- beginning of main
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
[Java][URL]URL:http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4
[Java][URL]Title:*DEMO* - Eita Porra
[Java][ThumbnailImage]
** Activity (main) Resume **
[Activity_Resume]
[VideoPlayerFullScreen1_onInitialized]
[Java][EventB4]Event:onState
[Java][EventB4]Parameter:0
[Java][videoplayerfullscreen1_onstate] exist!
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[VideoPlayerFullScreen1_onState]STATE_NORMAL
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][EventB4]Event:onState
[Java][EventB4]Parameter:1
[Java][videoplayerfullscreen1_onstate] exist!
[VideoPlayerFullScreen1_onState]STATE_PREPARING
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][EventB4]Event:onState
[Java][EventB4]Parameter:7
[Java][videoplayerfullscreen1_onstate] exist!
[VideoPlayerFullScreen1_onState]STATE_ERROR
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][EventB4]Event:onState
[Java][EventB4]Parameter:1
[Java][videoplayerfullscreen1_onstate] exist!
[VideoPlayerFullScreen1_onState]STATE_PREPARING
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][ReleaseAllVideos]
[Java][EventB4]onReset
[Java][EventB4]Event:onState
[Java][EventB4]Parameter:0
[Java][videoplayerfullscreen1_onstate] exist!
[VideoPlayerFullScreen1_onState]STATE_NORMAL
[Java][Play]
[Java][EventB4]onStarting
[Java][EventB4]Event:onState
[Java][EventB4]Parameter:1
[Java][videoplayerfullscreen1_onstate] exist!
[VideoPlayerFullScreen1_onState]STATE_PREPARING
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][EventB4]Event:onState
[Java][EventB4]Parameter:7
[Java][videoplayerfullscreen1_onstate] exist!
[VideoPlayerFullScreen1_onState]STATE_ERROR
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][ReleaseAllVideos]
[Java][EventB4]onReset
[Java][EventB4]Event:onState
[Java][EventB4]Parameter:0
[Java][videoplayerfullscreen1_onstate] exist!
[VideoPlayerFullScreen1_onState]STATE_NORMAL
** Activity (main) Pause, UserClosed = false **
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
[Java][DEMO] Remember this is a demo version of this library, please consider to buy me a coffee. Paypal: [email protected]
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
[Activity_Resume]
[VideoPlayerFullScreen1_onInitialized]
[VideoPlayerFullScreen1_onState]STATE_NORMAL
[VideoPlayerFullScreen1_onState]STATE_PREPARING
[VideoPlayerFullScreen1_onState]STATE_PLAYING
java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/app/AppCompatActivity;
    at cn.jzvd.JZUtils.getAppCompActivity(JZUtils.java:85)
    at cn.jzvd.JZUtils.getWindow(JZUtils.java:104)
    at cn.jzvd.JZUtils.hideStatusBar(JZUtils.java:164)
    at cn.jzvd.Jzvd.gotoScreenFullscreen(Jzvd.java:747)
    at cn.jzvd.Jzvd.onClick(Jzvd.java:209)
    at cn.jzvd.JzvdStd.onClick(JzvdStd.java:214)
    at android.view.View.performClick(View.java:5215)
    at android.view.View$PerformClick.run(View.java:21196)
    at android.os.Handler.handleCallback(Handler.java:742)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:157)
    at android.app.ActivityThread.main(ActivityThread.java:5601)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.AppCompatActivity" on path: DexPathList[[zip file "/data/app/com.visualnet.vpfullsample-2/base.apk"],nativeLibraryDirectories=[/data/app/com.visualnet.vpfullsample-2/lib/arm64, /vendor/lib64, /system/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
    ... 15 more
    Suppressed: java.lang.ClassNotFoundException: android.support.v7.app.AppCompatActivity
        at java.lang.Class.classForName(Native Method)
        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
        ... 16 more
    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
--------- beginning of crash
 

hamid77

Member
when I compile sample1, I receive this error:


B4X:
B4A Version: 10.2
Java Version: 8
Parsing code.    (0.01s)
Building folders structure.    (0.07s)
Compiling code.    (0.03s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (0.00s)
Compiling generated Java code.    (3.14s)
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension$AbstractDesugaringStrategy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension$ConcurrentWeakIdentityHashMap;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension$ConcurrentWeakIdentityHashMap$WeakKey;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension$MimicDesugaringStrategy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension$NullDesugaringStrategy;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/devtools/build/android/desugar/runtime/ThrowableExtension$ReuseDesugaringStrategy;
7 errors; aborting
 

Ewin

New Member
Licensed User
Hello Alberto
Please Help
i using your library and eror


java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/app/AppCompatActivity;
at cn.jzvd.JZUtils.getAppCompActivity(JZUtils.java:85)
at cn.jzvd.JZUtils.getWindow(JZUtils.java:104)
at cn.jzvd.JZUtils.hideStatusBar(JZUtils.java:164)
at cn.jzvd.Jzvd.gotoScreenFullscreen(Jzvd.java:747)
at cn.jzvd.Jzvd.onClick(Jzvd.java:209)
at cn.jzvd.JzvdStd.onClick(JzvdStd.java:214)
at android.view.View.performClick(View.java:5215)
at android.view.View$PerformClick.run(View.java:21196)
at android.os.Handler.handleCallback(Handler.java:742)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:157)
at android.app.ActivityThread.main(ActivityThread.java:5601)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:652)
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v7.app.AppCompatActivity" on path: DexPathList[[zip file "/data/app/com.visualnet.vpfullsample-2/base.apk"],nativeLibraryDirectories=[/data/app/com.visualnet.vpfullsample-2/lib/arm64, /vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
... 15 more
Suppressed: java.lang.ClassNotFoundException: android.support.v7.app.AppCompatActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 16 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
--------- beginning of crash
 
On dirassets you can't play, try like this:

First, copy the video to your project

View attachment 91670

and then

B4X:
    If File.Exists(File.DirAssets,"corona.mp4") Then
        File.Copy(File.DirAssets,"corona.mp4",File.DirInternal,"corona.mp4" )
    End If

    Dim strVideo As String = File.DirInternal & "/corona.mp4"
 
    VideoPlayerFullScreen1.URL(strVideo,"My Video")

hi
It may play a movie or audio from dirrootexternal?
 
Top