0

I am using below video player library and have to play video from local url.

Library is here : https://github.com/halilozercan/BetterVideoPlayer

I have done :

private lateinit var mVv_gym_toor_video: BetterVideoPlayer

vv_gym_gallery_video.setSource(Uri.fromFile(file))
vv_gym_gallery_video.start()

I am getting /storage/emulated/0/MyApp/Media/media_683c42.mp4 in file

In XML, I have taken as below :

                <com.halilibo.bvpkotlin.BetterVideoPlayer
                    app:bvp_showBottomProgressBar="false"
                    android:id="@+id/vv_gym_gallery_video"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dimen_200"
                    app:bvp_autoPlay="false"
                    app:bvp_disableControls="false"
                    app:bvp_hideControlsOnPlay="true"
                    app:bvp_pauseDrawable="@drawable/bvp_action_pause"
                    app:bvp_playDrawable="@drawable/bvp_action_play"
                    app:bvp_restartDrawable="@drawable/bvp_action_restart"
                    app:bvp_captionSize="22sp"
                    app:bvp_captionColor="@color/color_app_theme_dark"
                    app:bvp_gestureType="SwipeGesture"
                    app:bvp_loop="false" />

But, getting below error :

Caused by: java.util.UnknownFormatConversionException: Conversion = 'P'
    at java.util.Formatter$FormatSpecifier.conversion(Formatter.java:2781)
    at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2811)
    at java.util.Formatter$FormatSpecifierParser.<init>(Formatter.java:2624)
    at java.util.Formatter.parse(Formatter.java:2557)
    at java.util.Formatter.format(Formatter.java:2504)
    at java.util.Formatter.format(Formatter.java:2458)
    at java.lang.String.format(String.java:2770)
    at com.halilibo.bvpkotlin.BetterVideoPlayer$Companion.log(BetterVideoPlayer.kt:1072)
    at com.halilibo.bvpkotlin.BetterVideoPlayer$Companion.access$log(BetterVideoPlayer.kt:1064)
    at com.halilibo.bvpkotlin.BetterVideoPlayer.prepare(BetterVideoPlayer.kt:480)
    at com.halilibo.bvpkotlin.BetterVideoPlayer.setSource(BetterVideoPlayer.kt:372)
    at com.gymowner.ui.my_gym.fragments.GymGalleryFragment.onActivityResult(GymGalleryFragment.kt:437)
    at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:170)
    at android.app.Activity.dispatchActivityResult(Activity.java:7276)
    at android.app.ActivityThread.deliverResults(ActivityThread.java:4264)
3
  • Did you get solution on this? Commented Mar 12, 2020 at 6:30
  • @piyushporiya Changed Video library. BetterVideoPlayer is no longer supported. Commented Mar 13, 2020 at 12:46
  • Check this answer here: stackoverflow.com/a/77988364/9133569 Commented Feb 13, 2024 at 13:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.