Code Monkey home page Code Monkey logo

bettervideoplayer's Introduction

Hi there ๐Ÿ‘‹

I'm currently working as a Software Engineer in Android Text Team at Google.

bettervideoplayer's People

Contributors

afollestad avatar autovalue avatar bulwinkel avatar franciscofranco avatar halilozercan avatar hex1y avatar porkyhead avatar zsmb13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bettervideoplayer's Issues

Plackback in background like music player

How to play video in the background like a music player play songs in the background and user can use the device.

Tried this, but unable to integrate BetterVideoPlayer and i also found the illegalStateException:
https://stackoverflow.com/questions/8830111/integrating-video-file-in-android-app-as-app-background

03-05 15:27:31.103 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: java.lang.IllegalStateException
03-05 15:27:31.103 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.media.MediaPlayer.prepareAsync(Native Method)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at com.example.kushaalsingla.contentsharingdemo.VideoPlayOnSurfaceView.surfaceCreated(VideoPlayOnSurfaceView.java:59)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.SurfaceView.updateWindow(SurfaceView.java:597)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.SurfaceView.onWindowVisibilityChanged(SurfaceView.java:243)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.View.dispatchWindowVisibilityChanged(View.java:9663)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1310)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1310)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1310)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1310)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1310)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.ViewGroup.dispatchWindowVisibilityChanged(ViewGroup.java:1310)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1415)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1139)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6064)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:860)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:672)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.Choreographer.doFrame(Choreographer.java:608)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:846)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.os.Handler.handleCallback(Handler.java:742)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.os.Looper.loop(Looper.java:157)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5555)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at java.lang.reflect.Method.invoke(Native Method)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:745)
03-05 15:27:31.104 24084-24084/com.example.kushaalsingla.contentsharingdemo W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:635)

AC-3 Codec

Please give support to AC-3 Codec format. Only Video is coming no Audio

Video skipping seconds when pause / play

Hello, I am facing serious problems, when I pause a video and play next, the video that for example was in 2 seconds, it changes to 7, the image is frozen until the audio arrives in the 7 seconds. Apparently the audio does not have this problem, it continues where it stopped, but the video, skips several pictures.

I posted a video on youtube to better show the problem, observe the timing of the video, when paused, and when played.

My XML:

<com.halilibo.bettervideoplayer.BetterVideoPlayer
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/player"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

My Code:
public class videoPlayerActivity extends AppCompatActivity implements BetterVideoCallback {
private BetterVideoPlayer player;

int position = 0;

String TAG = "statusVideo";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_video_player);


    player = (BetterVideoPlayer) findViewById(R.id.player);
    player.setCallback(this);
    player.setSource(Uri.parse("https://instagram.fbhz2-1.fna.fbcdn.net/t50.2886-16/22251533_131289287518083_2969207214956347392_n.mp4"));


}
@Override
public void onPause() {
    super.onPause();
    // Make sure the player stops playing if the user presses the home button.
    player.pause();
}

// Methods for the implemented EasyVideoCallback

@Override
public void onStarted(BetterVideoPlayer player) {
    Log.i(TAG, "Started");

}

@Override
public void onPaused(BetterVideoPlayer player) {
    Log.i(TAG, "Paused");

}

@Override
public void onPreparing(BetterVideoPlayer player) {
    Log.i(TAG, "Preparing");
}

@Override
public void onPrepared(BetterVideoPlayer player) {
    Log.i(TAG, "Prepared");
}

@Override
public void onBuffering(int percent) {
    Log.i(TAG, "Buffering " + percent);
}

@Override
public void onError(BetterVideoPlayer player, Exception e) {
    Log.i(TAG, "Error " +e.getMessage());
}

@Override
public void onCompletion(BetterVideoPlayer player) {
    Log.i(TAG, "Completed");
}

@Override
public void onToggleControls(BetterVideoPlayer player, boolean isShowing) {
    Log.i(TAG, "Controls toggled " + isShowing);
}

}``

Subtitles Decoding for languages like Arabic or Greek

-- [ ] I have verified there are no duplicate active or recent bugs, questions, or requests
-- [ ] I have verified that I am using the latest version of Better Video Player.
-- [ ] I have given my issue a non-generic title.
-- [ ] I have read over the documentation (before asking questions on how to do something).

Hi, How can I correctly display subtitles for language like Arabic, Greek or even French.Arabic for instance is being displayed as seen on the attached image.
screenshot_2017-08-09-23-35-15

No resource Identifier found

screen shot 2017-05-15 at 5 30 32 pm

screen shot 2017-05-15 at 5 30 46 pm

bvp:bvp_showBottomProgressBar="true"
bvp:bvp_showTotalDuration="false" when i try to run the code I got issues for reference first screenshot. Second screenshot is Code.

what is SubtitleView?

-- [ ] I have verified there are no duplicate active or recent bugs, questions, or requests
-- [ ] I have verified that I am using the latest version of Better Video Player.
-- [ ] I have given my issue a non-generic title.
-- [ ] I have read over the documentation (before asking questions on how to do something).

Hi

I just downloaded demo,and add this:

// Online SUBRIP subtitle
bvp.setCaptions("https://www.example.com/subrip.srt", SubtitleView.SubtitleMime.SUBRIP);

but I dont know what is SubtitleView?

License information

Hello,
Depending on the license, we cannot use this great library.
Can you add a license file in your project ?
thanks !

Stretch small video to the whole screen

Hi!
Many thanks for the great videoplayer!
But I have one problem with this. Can you explain, how I can stretch a small video to the whole screen? Currently it's being played in a rectangle that is less than the screen, but I want to increase it to fit all screen space. Is it possible?

NullPointerException - After completion of video playing clicking on replay control

Android: 6.0.1
Android Build: MMB29M.N910GDTU1DQD4
Manufacturer: samsung
Model: SM-N910G
Thread: main-1
CrashReporter Key: 39646626-6511-1F75-8090-1570DF6712CA423299B3
Start Date: Mon May 15 12:18:01 GMT+05:30 2017
Date: Mon May 15 12:20:15 GMT+05:30 2017

java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.media.MediaPlayer.isPlaying()' on a null object reference
at com.halilibo.bettervideoplayer.BetterVideoPlayer.onClick(BetterVideoPlayer.java:804)
at android.view.View.performClick(View.java:5697)
at android.view.View$PerformClick.run(View.java:22526)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7225)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

is it possible to move from player to full screen without an external button?

-- [x ] I have verified there are no duplicate active or recent bugs, questions, or requests
-- [x ] I have verified that I am using the latest version of Better Video Player.
-- [ x] I have given my issue a non-generic title.
-- [ x] I have read over the documentation (before asking questions on how to do something).

-###### Include the following:

    • Better Video Player version: 1.1.0
    • Device OS version: 7.0
    • Device Manufacturer: Samsung
    • Device Name: S8+

Is it possible to add a "show in full screen button" in the controls view?
or alternatively - support a double tap on the player itself(like youtube/facebook for example)?
or both :-)

Support for styling for the subtitles.

It would be nice if developers had the ability to choose the visual presentation of the subtitles.

e.g. transluscent background overlay, font size, font color etc.

gesture based brightness control issue...

    • Better Video Player version: 1.1.0
    • Device OS version: 4.1.2
    • Device Manufacturer: Samsung
    • Device Name: Samsung Duos

-###### Reproduction Steps
-enable brightness gesture by adding player.enableSwipeGestures(getWindow());
-1.open the video player
-2.try brightness guesture
-3.when brightness reaches "0" it turn off the screen completely....phone must be restarted after that to make it work again..

-###### Expected Result
-cellphone screen should not turnoff when brightness reaches "0"

-###### Actual Result
when brightness reaches "0" it turn off the screen completely....phone must be restarted after that to make it work again..

Missing FadingCircle of SpinKitView after adding to gradle

-- [ x] I have verified there are no duplicate active or recent bugs, questions, or requests
-- [x ] I have verified that I am using the latest version of Better Video Player.
-- [ x] I have given my issue a non-generic title.
-- [ x] I have read over the documentation (before asking questions on how to do something).

-###### Include the following:

    • Better Video Player version: 1.2.alpha1

-###### Reproduction Steps

-1. Added to both gradle files what was written in README
-2. Wait for gradle to sync
-3. Thats it now I got that error

-###### Expected Result

  • It shouldn't error and work

-###### Actual Result
This error (Android issues) :
error: resource style/SpinKitView.Large.FadingCircle (aka com.test.app:style/SpinKitView.Large.FadingCircle) not found. Message{kind=ERROR, text=error: resource style/SpinKitView.Large.FadingCircle (aka com.test.app:style/SpinKitView.Large.FadingCircle) not found., sources=[C:\Users\Fesvz\.gradle\caches\transforms-1\files-1.1\BetterVideoPlayer-1.2.alpha1.aar\ee6a6260a7f6e32e34ed3274b1083750\res\layout\bvp_include_progress.xml:7], original message=, tool name=Optional.of(AAPT)}

How can I play a .ts in BetterVideoPlayer?

I started using "BetterVideoPlaye" recently to play stream links in my android application, such as .m3u8 and .mp4 files, but when I tried to play .ts files, the player didn't recognized the stream type...

Is there any way to play .ts files in BetterVideoPlayer?

How to disable thumbnail

When loaded from server set thumbnail on the video, how can i disable this thumbnail and not show this thumbnail on video?

at com.halilibo.bettervideoplayer.BetterVideoPlayer.prepare(BetterVideoPlayer.java:357)

How to fix?

Please Help me!

Fatal Exception: java.lang.IllegalStateException
at android.media.MediaPlayer.nativeSetDataSource(MediaPlayer.java)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1208)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1192)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1146)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.prepare(BetterVideoPlayer.java:357)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.onSurfaceTextureAvailable(BetterVideoPlayer.java:667)
at android.view.TextureView.getHardwareLayer(TextureView.java:368)
at android.view.View.updateDisplayListIfDirty(View.java:16496)
at android.view.View.draw(View.java:17295)
at android.view.ViewGroup.drawChild(ViewGroup.java:3926)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3716)
at android.view.View.updateDisplayListIfDirty(View.java:16514)
at android.view.View.draw(View.java:17295)
at android.view.ViewGroup.drawChild(ViewGroup.java:3926)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3716)
at android.view.View.draw(View.java:17529)
at android.view.View.updateDisplayListIfDirty(View.java:16519)
at android.view.View.draw(View.java:17295)
at android.view.ViewGroup.drawChild(ViewGroup.java:3926)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3716)
at android.view.View.draw(View.java:17529)
at android.view.View.updateDisplayListIfDirty(View.java:16519)
at android.view.View.draw(View.java:17295)
at android.view.ViewGroup.drawChild(ViewGroup.java:3926)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3716)
at android.view.View.updateDisplayListIfDirty(View.java:16514)
at android.view.View.draw(View.java:17295)
at android.view.ViewGroup.drawChild(ViewGroup.java:3926)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3716)
at android.view.View.updateDisplayListIfDirty(View.java:16514)
at android.view.View.draw(View.java:17295)
at android.view.ViewGroup.drawChild(ViewGroup.java:3926)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3716)
at android.view.View.updateDisplayListIfDirty(View.java:16514)
at android.view.View.draw(View.java:17295)
at android.view.ViewGroup.drawChild(ViewGroup.java:3926)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3716)
at android.view.View.updateDisplayListIfDirty(View.java:16514)
at android.view.View.draw(View.java:17295)
at android.view.ViewGroup.drawChild(ViewGroup.java:3926)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3716)
at android.view.View.updateDisplayListIfDirty(View.java:16514)
at android.view.View.draw(View.java:17295)
at android.view.ViewGroup.drawChild(ViewGroup.java:3926)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3716)
at android.view.View.draw(View.java:17529)
at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:3187)
at android.view.View.updateDisplayListIfDirty(View.java:16519)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:325)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:331)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:366)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3234)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3033)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2615)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1528)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7530)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:911)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:622)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7325)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

UDP FileNotFoundException

04-16 21:34:08.399 8036-8036/org.zaryans.bestplayertest D/MediaPlayer: setDataSource IOException | SecurityException happend :
java.io.FileNotFoundException: No content provider: udp://@xxx.x.x:3000
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1139)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:990)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:913)
at android.media.MediaPlayer.attemptDataSource(MediaPlayer.java:1110)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1101)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.prepare(BetterVideoPlayer.java:360)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.onSurfaceTextureAvailable(BetterVideoPlayer.java:667)
at android.view.TextureView.getHardwareLayer(TextureView.java:390)
at android.view.TextureView.draw(TextureView.java:339)
at android.view.View.updateDisplayListIfDirty(View.java:17537)
at android.view.View.draw(View.java:18321)
at android.view.ViewGroup.drawChild(ViewGroup.java:3946)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3732)
at android.view.View.updateDisplayListIfDirty(View.java:17532)
at android.view.View.draw(View.java:18321)
at android.view.ViewGroup.drawChild(ViewGroup.java:3946)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3732)
at android.view.View.draw(View.java:18562)
at android.view.View.updateDisplayListIfDirty(View.java:17537)
at android.view.View.draw(View.java:18321)
at android.view.ViewGroup.drawChild(ViewGroup.java:3946)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3732)
at android.view.View.updateDisplayListIfDirty(View.java:17532)
at android.view.View.draw(View.java:18321)
at android.view.ViewGroup.drawChild(ViewGroup.java:3946)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3732)
at android.view.View.updateDisplayListIfDirty(View.java:17532)
at android.view.View.draw(View.java:18321)
at android.view.ViewGroup.drawChild(ViewGroup.java:3946)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3732)
at android.view.View.updateDisplayListIfDirty(View.java:17532)
at android.view.View.draw(View.java:18321)
at android.view.ViewGroup.drawChild(ViewGroup.java:3946)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3732)
at android.view.View.updateDisplayListIfDirty(View.java:17532)
at android.view.View.draw(View.java:18321)
at android.view.ViewGroup.drawChild(ViewGroup.java:3946)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3732)
at android.view.View.updateDisplayListIfDirty(View.java:17532)
at android.view.View.draw(View.java:18321)
at android.view.ViewGroup.drawChild(ViewGroup.java:3946)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3732)
at android.view.View.draw(View.java:18562)
at com.android.internal.policy.DecorView.draw(DecorView.java:986)
at android.view.View.updateDisplayListIfDirty(View.java:17537)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:713)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:719)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:827)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:3204)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2991)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2579)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1569)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7296)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:930)
at android.view.Choreographer.doCallbacks(Choreographer.java:705)
at android.view.Choreographer.doFrame(Choreographer.java:640)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:916)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6816)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1563)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1451)

java.net.ProtocolException: unexpected end of stream

I am trying to create activity with player which will play files which size is about ~100Mb. When video is buffering, for example to 10%, it pause buffering. And now when player is trying to continue buffering, i am getting this in logcat:
W/MediaHTTPConnection: readAt 23892772 / 27868 => java.net.ProtocolException: unexpected end of stream
I've noticed that when i am using small video, like 5-10Mb it doesn't happen

My Activity:
`package pl.---.---.ui.videoPlayer;

import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.halilibo.bettervideoplayer.BetterVideoPlayer;

import pl.---.---.R;

import butterknife.BindView;
import butterknife.ButterKnife;

public class VideoPlayerActivity extends AppCompatActivity {

@BindView(R.id.player)
BetterVideoPlayer player;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_video_player);
    ButterKnife.bind(this);

    Bundle extras = getIntent().getExtras();
    String link = extras.getString("link");
    String title = extras.getString("title");

    player.setSource(Uri.parse(link));
    player.setTitle(title);
}

}`

I've noticed also that it is always heppening after this in logcat:
W/art: Suspending all threads took: *ms

What can i do to avoid this?

BetterVideoPlayer.prepare

I am getting most of the time
Fatal Exception: java.lang.IllegalStateException
at android.media.MediaPlayer.nativeSetDataSource(MediaPlayer.java)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1204)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1188)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1142)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.prepare(BetterVideoPlayer.java:357)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.onSurfaceTextureAvailable(BetterVideoPlayer.java:667)
at android.view.TextureView.getHardwareLayer(TextureView.java:370)
at android.view.View.updateDisplayListIfDirty(View.java:15443)
at android.view.View.getDisplayList(View.java:15488)
at android.view.View.draw(View.java:16258)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15461)
at android.view.View.getDisplayList(View.java:15488)
at android.view.View.draw(View.java:16258)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.draw(View.java:16539)
at android.view.View.updateDisplayListIfDirty(View.java:15466)
at android.view.View.getDisplayList(View.java:15488)
at android.view.View.draw(View.java:16258)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15461)
at android.view.View.getDisplayList(View.java:15488)
at android.view.View.draw(View.java:16258)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15461)
at android.view.View.getDisplayList(View.java:15488)
at android.view.View.draw(View.java:16258)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15461)
at android.view.View.getDisplayList(View.java:15488)
at android.view.View.draw(View.java:16258)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.updateDisplayListIfDirty(View.java:15461)
at android.view.View.getDisplayList(View.java:15488)
at android.view.View.draw(View.java:16258)
at android.view.ViewGroup.drawChild(ViewGroup.java:3713)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3506)
at android.view.View.draw(View.java:16539)
at android.widget.FrameLayout.draw(FrameLayout.java:598)
at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:3111)
at android.view.View.updateDisplayListIfDirty(View.java:15466)
at android.view.View.getDisplayList(View.java:15488)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:309)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:315)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:354)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:2956)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2753)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2339)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1314)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7057)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:829)
at android.view.Choreographer.doCallbacks(Choreographer.java:606)
at android.view.Choreographer.doFrame(Choreographer.java:576)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:815)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6934)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)

Show controls doesn't work.

I am trying to show controls on start of the video. But it automatically hides. Is there is any fix around?
mPlayer.showControls();

-###### Include the following:

    • Better Video Player version: 1.1.0
    • Device OS version: 7.0
    • Device Manufacturer: Huawei
    • Device Name: Nexus 6P

seekTo(0) does not go to the position 0

  • [x ] I have verified there are no duplicate active or recent bugs, questions, or requests
  • [ x] I have verified that I am using the latest version of Better Video Player.
  • [ x] I have given my issue a non-generic title.
  • [ x] I have read over the documentation (before asking questions on how to do something).
Include the following:
  • Better Video Player version: 1.1.0
  • Device OS version: 6.0.1
  • Device Manufacturer: BQ
  • Device Name: Aquarius U Plus

-Also, please wrap Java with correct syntax highlighting.
I'm using Kotlin

fun initBtn() {
    var startedYet = false

    initPlayer()

    fitnessTestStartEndBtn.onClick {
        if (!startedYet) {
            if (fitnessTestPlayer.isPrepared) {
                if (fitnessTestPlayer.currentPosition != 0) fitnessTestPlayer.seekTo(0)
                startedYet = true
                fitnessTestPlayer.start()
            }
        } else {
            fitnessTestPlayer.pause()
            startedYet = false
        }
    }
}

fun initPlayer() {
    fitnessTestPlayer.reset()
    fitnessTestPlayer.setCallback(this)

    if (whichExercise == RESQUEST1)
        fitnessTestPlayer.setSource(Uri.parse(myUrl1))
    else if (whichExercise == RESQUEST2) {
        fitnessTestPlayer.setSource(myUrl2))
    }

    fitnessTestPlayer.setAutoPlay(false)
    fitnessTestPlayer.setLoop(true)
}

override fun onPause() {
    fitnessTestPlayer.pause()
    super.onPause()
}
Reproduction Steps

-1. Set a data source to player
-2. Play it, finish or pause activity and reopen it

Expected Result
  • Set a data source to player
  • Play it, finish or pause activity and reopen it
  • Player should start the video from the beggining
Actual Result
  • Player remains in the position where it was paused before fenishing or pausing the activity

Brightness adjustment on scroll-up not working

Do I need to enable any property for the brightness adjustment to work? Volume adjustment works fine in the player.

BTW, its neat to use when compared to other players. Good work so far ๐Ÿ‘

setCaptions,subtitle not show from local storage

Hello guys
load subtitle from local storage is not working.

to solve this problem go to CaptionsView class

and modify this method public void setCaptionsSource(@Nullable Uri path, CMime mime) {

replace track = getSubtitleFile(path.toString()); with track = getSubtitleFile(path.getPath());

good luck ๐Ÿ‘

Local Subtitle

hi

i use this library and i need complete app for next 2 day

i want to use local subtitle in video player how i must do this?

java.util.MissingFormatArgumentException: Format specifier: 2F

java.util.MissingFormatArgumentException: Format specifier: 2F
at java.util.Formatter.getArgument(Formatter.java:1111)
at java.util.Formatter.doFormat(Formatter.java:1076)
at java.util.Formatter.format(Formatter.java:1042)
at java.util.Formatter.format(Formatter.java:1011)
at java.lang.String.format(String.java:1554)
at java.lang.String.format(String.java:1528)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.LOG(BetterVideoPlayer.java:871)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.prepare(BetterVideoPlayer.java:323)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.onSurfaceTextureAvailable(BetterVideoPlayer.java:562)
at android.view.TextureView.getHardwareLayer(TextureView.java:368)
at android.view.View.updateDisplayListIfDirty(View.java:15233)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.draw(View.java:16262)
at android.view.View.updateDisplayListIfDirty(View.java:15256)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.draw(View.java:16262)
at android.view.View.updateDisplayListIfDirty(View.java:15256)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.draw(View.java:16262)
at android.view.View.updateDisplayListIfDirty(View.java:15256)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3444)
at android.view.View.updateDisplayListIfDirty(View.java:15251)
at android.view.View.draw(View.java:16029)
at android.view.ViewGroup.drawChild(ViewGroup.java:3654)

Changing the source url throws

java.lang.IllegalStateException
at android.media.MediaPlayer.nativeSetDataSource(Native Method)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1179)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1140)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.prepare(BetterVideoPlayer.java:324)
at com.halilibo.bettervideoplayer.BetterVideoPlayer.setSource(BetterVideoPlayer.java:236)

How to forward video based on time?

I need to forward the video programmatically based on time, e.g need to play 10:15 frame in the video when player start. can you please tell me how to do it?

onResume cause 4:3 video stretch to 16:9

  • [ X] I have verified there are no duplicate active or recent bugs, questions, or requests
  • [ X] I have verified that I am using the latest version of Better Video Player.
  • [ X] I have given my issue a non-generic title.
  • [ X] I have read over the documentation (before asking questions on how to do something).
Include the following:
  • Better Video Player version: 1.1.0
  • Device OS version: 4.4.2
  • Device Manufacturer: iOcean
  • Device Name: X7 Plus

I've found that if you watch 4:3 video with BVP it shows normally, but if you hide app (with home button) and reopen it again - video will stretch to 16:9. How i can avoid this?

Reproduction Steps
  1. Open 4:3 video for watch
  2. Tap home
  3. Open app again
  4. Video is 16:9 now
Expected Result
  • Video must have same aspect ratio after app resume

Brightness gesture doesnt work on first try

    • Better Video Player version: `1.2.alpha1
    • Device OS version: 7.0
    • Device Manufacturer: Samsung
    • Device Name: Galaxy S7

Brightness sider doesnt work on first try. Steps required to reproduce:

  1. Start video with a source and let the video start playing
  2. Swipe up to change the brightness

Expected outcome:
Brightness number should become positive and I should physically see the brightness of the screen go up.

Actual outcome:
Brightness is set to 0 and stays at zero even if I am swiping up or down. Once I release my finger from the screen and swipe up/down again on left side of the screen only then does the brightness change correctly.

Below is my implementation:

public class Player extends AppCompatActivity implements BetterVideoCallback {

    private BetterVideoPlayer player;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_player);

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

        player = findViewById(R.id.player);
        player.setCallback(this);
        player.setSource(Uri.parse(getIntent().getStringExtra("movieURL")));
        player.getToolbar().setTitle(getIntent().getStringExtra("movieTitle"));
        player.enableSwipeGestures(getWindow());
        player.setLoadingStyle(2);

    }
    }
    ...
}

and here is my XML:

<com.halilibo.bettervideoplayer.BetterVideoPlayer
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/player"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:bvp_gestureType="SwipeGesture"
        app:bvp_autoPlay="true" />

Ive also tried using swipe gestures only in XML, and then only in the code. Both times I get the same outcome

Video going wide, not at full screen

-- [X] I have verified there are no duplicate active or recent bugs, questions, or requests
-- [X] I have verified that I am using the latest version of Better Video Player.
-- [X] I have given my issue a non-generic title.
-- [X] I have read over the documentation (before asking questions on how to do something).

Hi.

I have an issue, when the user goes on landscape mode (starting on portrait mode), the video keeps stretching out and not occupying the full height of the screen. However, I have figured out that if the user goes portrait and landscape again this doesn't happen anymore for this video.

Swipe gestures on video dont seem to work

    • Better Video Player version: `1.2.alpha1
    • Device OS version: 7.0
    • Device Manufacturer: Samsung
    • Device Name: Galaxy S7

I have enabled swipe gestures in my application as follows:

public class Player extends AppCompatActivity implements BetterVideoCallback {

    private BetterVideoPlayer player;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_player);

        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

        getIntent().getStringExtra("movieTitle");
        player = findViewById(R.id.player);
        player.setCallback(this);
        player.enableSwipeGestures();
        player.enableSwipeGestures(getWindow());
        player.setSource(Uri.parse(getIntent().getStringExtra("movieURL")));
        player.setAutoPlay(true);
        player.setLoadingStyle(2);
        player.enableDoubleTapGestures(60000);
    }
    ...
}

But when I perform any swipe gesture, may that be swipe up,down,left or right. Nothing happens

.reset() does not work

Player.reset(); -> does not work anymore in 1.1.0... Player does not play after you reset and set source, also tapping on player causes FC

code:

Player.reset();
Player.setAutoPlay(true);
Player.setSource(Uri.parse(getUrl()));

however this method worked in earlier 1.0.0 version...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.