B4A Library EasyVideoPlayer

Discussion in 'Additional libraries, classes and official updates' started by DonManfred, May 22, 2016.

  1. DonManfred

    DonManfred Expert Licensed User

    This is a wrap for this github project.

    EasyVideoPlayer
    Author:
    DonManfred (wrapper)
    Version: 1.51
    • EasyVideoPlayer
      Events:
      • onBuffering (percent As Int)
      • onCompletion ( As )
      • onError (error As String)
      • onPrepared ( As )
      • onPreparing ( As )
      • onRetry (source As Uri)
      • onSubmit (source As Uri)
      • onVideoProgressUpdate (position As Int, duration As Int)
      Fields:
      • LEFT_ACTION_NONE As Int
      • LEFT_ACTION_RESTART As Int
      • LEFT_ACTION_RETRY As Int
      • RIGHT_ACTION_CUSTOM_LABEL As Int
      • RIGHT_ACTION_NONE As Int
      • RIGHT_ACTION_SUBMIT As Int
      • ba As BA
      Methods:
      • BringToFront
      • DesignerCreateView (base As PanelWrapper, lw As LabelWrapper, props As Map)
      • Initialize (EventName As String)
      • Invalidate
      • Invalidate2 (arg0 As Rect)
      • Invalidate3 (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
      • IsInitialized As Boolean
      • RemoveView
      • RequestFocus As Boolean
      • SendToBack
      • SetBackgroundImage (arg0 As Bitmap)
      • SetColorAnimated (arg0 As Int, arg1 As Int, arg2 As Int)
      • SetLayout (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int)
      • SetLayoutAnimated (arg0 As Int, arg1 As Int, arg2 As Int, arg3 As Int, arg4 As Int)
      • SetVisibleAnimated (arg0 As Int, arg1 As Boolean)
      • disableControls
      • enableControls (andShow As Boolean)
      • hideControls
      • isControlsShown As Boolean
      • isPlaying As Boolean
      • isPrepared As Boolean
      • pause
      • release
      • reset
      • seekTo (pos As Int)
      • showControls
      • start
      • stop
      • toggleControls
      Permissions:
      • android.permission.ACCESS_NETWORK_STATE
      • android.permission.INTERNET
      Properties:
      • AutoPlay As Boolean [write only]
      • Background As Drawable
      • BottomLabelText As CharSequence [write only]
      • Color As Int [write only]
      • CurrentPosition As Int [read only]
      • CustomLabelText As CharSequence [write only]
      • Duration As Int [read only]
      • Enabled As Boolean
      • Height As Int
      • HideControlsOnPlay As Boolean [write only]
      • InitialPosition As Int [write only]
      • Left As Int
      • LeftAction As Int [write only]
      • Parent As Object [read only]
      • PauseDrawable As Drawable [write only]
      • PauseDrawableRes As String [write only]
      • PlayDrawable As Drawable [write only]
      • PlayDrawableRes As String [write only]
      • RestartDrawable As Drawable [write only]
      • RestartDrawableRes As String [write only]
      • RetryText As CharSequence [write only]
      • RightAction As Int [write only]
      • Source As String [write only]
      • SubmitText As CharSequence [write only]
      • Tag As Object
      • ThemeColor As Int [write only]
      • Top As Int
      • Visible As Boolean
      • Width As Int
     

    Attached Files:

  2. ilan

    ilan Expert Licensed User

    Rockefeller Goldman likes this.
  3. itgirl

    itgirl Active Member Licensed User

    :) thanks for this great one
     
  4. MarcoRome

    MarcoRome Expert Licensed User

    Hi Don. Great library. I have this error when start:
     
  5. DonManfred

    DonManfred Expert Licensed User

    Did you changed this to match your paths?
    Code:
    #AdditionalRes: $AdditionalLibs$\b4a_appcompat, de.amberhome.objects.appcompat
     
  6. susu

    susu Well-Known Member Licensed User

    Hi @DonManfred

    I copied Appcompat lib and res to Additional Libraries and changed the path:
    #AdditionalRes: C:\Program Files (x86)\Anywhere Software\Basic4android\Additional Libraries\b4a_appcompat, de.amberhome.objects.appcompat
    #AdditionalRes: D:\android-sdk\extras\android\support\v7\appcompat\res, android.support.v7.appcompat

    But I got this error:

    Code:
    Generating R file.    Error
    d:\android-sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:
    20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
    d:\android-sdk\extras\android\support\v7\appcompat\res\values-v23\styles_base_text.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
     
    aidymp likes this.
  7. aidymp

    aidymp Active Member Licensed User

    I have had to reinstall the Android SDK and it seems the newer versions the SDK downloads are missing some files! i just had to solve the google play services problem, for another app, and now I dont have the android-sdk\extras\android\support\v7\appcompat\res folder either! any clue as to how to solve this, the google play one is easy to find on google and sort but i can see anything regarding this!
     
  8. Johan Schoeman

    Johan Schoeman Expert Licensed User

    I get the following on my S4 mini with KitKat and have been battling with this for a few days now:

    Code:
    LogCat connected to: 24be32de
    --------- beginning of /dev/
    log/system
    --------- beginning of /dev/
    log/main
    ** 
    Activity (main) Pause, UserClosed = false **
    ** 
    Activity (main) Resume **
    ** 
    Activity (main) Pause, UserClosed = false **
    ** 
    Activity (main) Resume **
    ** 
    Activity (main) Pause, UserClosed = true **
    ** 
    Service (starter) Create **
    ** 
    Service (starter) Start **
    ** 
    Activity (main) Create, isFirst = true **
    in init
    GOT UP 
    TO HERE
    main_activity_create (java line: 
    322)
    java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
        at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:
    166)
        at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:
    208)
        at JHS.EasyVideoPlayer.main._activity_create(main.java:
    322)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    515)
        at anywheresoftware.b4a.BA.raiseEvent2(BA.java:
    169)
        at JHS.EasyVideoPlayer.main.afterFirstLayout(main.java:
    102)
        at JHS.EasyVideoPlayer.main.access$
    000(main.java:17)
        at JHS.EasyVideoPlayer.main$WaitForLayout.run(main.java:
    80)
        at android.os.Handler.handleCallback(Handler.java:
    733)
        at android.os.Handler.dispatchMessage(Handler.java:
    95)
        at android.os.Looper.loop(Looper.java:
    146)
        at android.app.ActivityThread.main(ActivityThread.java:
    5593)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
    1283)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:
    1099)
        at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.reflect.InvocationTargetException
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:
    515)
        at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:
    64)
        at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:
    158)
        ... 
    17 more
    Caused by: android.view.InflateException: Binary XML 
    file line #46: Error inflating class ImageButton
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:
    719)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:
    761)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:
    498)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:
    398)
        at com.afollestad.easyvideoplayer.EasyVideoPlayer.init(EasyVideoPlayer.java:
    252)
        at com.afollestad.easyvideoplayer.EasyVideoPlayer.<init>(EasyVideoPlayer.java:
    73)
        at de.donmanfred.EasyVideoPlayerWrapper._initialize(EasyVideoPlayerWrapper.java:
    75)
        ... 
    21 more
    Caused by: android.content.res.Resources$NotFoundException: 
    File res/drawable/evp_action_restart.xml from drawable resource ID #0x7f02004d
        at android.content.res.Resources.loadDrawable(Resources.java:
    3443)
        at android.content.res.TypedArray.getDrawable(TypedArray.java:
    602)
        at android.widget.ImageView.<init>(
    ImageView.java:133)
        at android.widget.ImageButton.<init>(ImageButton.java:
    88)
        at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:
    57)
        at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:
    53)
        at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:
    118)
        at android.support.v7.app.AppCompatDelegateImplV7.createView(AppCompatDelegateImplV7.java:
    972)
        at android.support.v7.app.AppCompatDelegateImplV7.onCreateView(AppCompatDelegateImplV7.java:
    1031)
        at android.support.v4.view.LayoutInflaterCompatHC$FactoryWrapperHC.onCreateView(LayoutInflaterCompatHC.java:
    44)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:
    690)
        ... 
    27 more
    Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML 
    file line #1: invalid drawable tag vector
        at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:
    986)
        at android.graphics.drawable.Drawable.createFromXml(Drawable.java:
    930)
        at android.content.res.Resources.loadDrawable(Resources.java:
    3439)
        ... 
    37 more
     
  9. Johan Schoeman

    Johan Schoeman Expert Licensed User

    I had a similar sort of problem when I wrapped a Github project and solved it by removing the values-v23 folder from this path (below is my folder path)
    C:\ANDRIOD_SDK_TOOLS\extras\android\support\v7\appcompat\res

    Try it - maybe it works...it should divert to values-v22 and just perhaps it solves your problem
     
    aidymp likes this.
  10. NJDude

    NJDude Expert Licensed User

    Are you compiling using SDK 23? (Check your B4A paths: Tools - > Configure Paths -> Android.jar)

    AppCompat is a pain in the ass sometimes.
     
  11. MarcoRome

    MarcoRome Expert Licensed User

    Of Course Don. But anyway i think that depend on the new sdk 30 ( really a nightmare )
    I say this because i have also tried an older version that uses de.amberhome.objects.appcompat is i have the same problem.

    Look movie ( same error with 2 apps different ) :




    Another think if you look new SDK you have this situation - Android Support Library ( Obsolete )


    Immagine.jpg


    I'd go back to the "old" SDK Android....
    Someone know there are other sources where to install the Android SDK previous full ??
    Thank you
     
  12. MarcoRome

    MarcoRome Expert Licensed User

    Look also this:

    ONE
     
    Johan Schoeman and lemonisdead like this.
  13. DonManfred

    DonManfred Expert Licensed User

    i am using v29 and did not make any sdk update after i saw the problems with v30 here in forum.

    I don´t know what to do, sorry.
     
    aidymp and MarcoRome like this.
  14. MarcoRome

    MarcoRome Expert Licensed User

    ALL WORK, now that i'm back to the "old" Android SDK. If you have problem look also this THREAD
     
    Johan Schoeman likes this.
  15. aidymp

    aidymp Active Member Licensed User

    Yes! that works!

    Thanks

    Aidy
     
  16. MarcoRome

    MarcoRome Expert Licensed User

    Hi Johan. Now, that i update SDK i have same problem. Do you have solved this ?
    Thank you
     
  17. Johan Schoeman

    Johan Schoeman Expert Licensed User

    No, I have not. Have put it one side to revisit sometime in future...
     
  18. MarcoRome

    MarcoRome Expert Licensed User

    For sure is new SDK, because with "old" SDK work without problem.
    Anyway thank you for your response
     
  19. itgirl

    itgirl Active Member Licensed User

    Hello , i think im having troubles trying to add the view pragmatically

    Code:
    Dim MovPlayer As EasyVideoPlayer
    MovPlayer.Initialize(
    "MovPlayer")
    VideoPanel.AddView(MovPlayer, 
    00, VideoPanel.Width,VideoPanel.Height)
    returns

    Code:
    android.view.InflateException: Binary XML file line #46: Error inflating class android.widget.ImageButton
     
  20. itgirl

    itgirl Active Member Licensed User

    OK thanks to ;)DonManfred;) for posting the source code which i really thank him for, I learned alot from his contributions to this community i figured the problem was in CustomViewWrapper.replaceBaseWithView so i decided to play around with this i tried to just noramlly addview base.AddView(getObject() and Whoa the error is gone and everything woked again... so i just have to change things a bit and try to get the height and width correctly and everything is up and working again


    thanks Don;)
     
    DonManfred likes this.
Loading...