java.net.ProtocolException: unexpected end of stream while video streaming

Viewed 1467

I am trying to create activity with video player, based on BetterVideoPlayer lib. When player has to buffer video which has about 100Mb, always after this log:

W/art: Suspending all threads took: 6.342ms

When library is trying to continue buffering (after pause on for example 20%) i am getting this:

W/MediaHTTPConnection: readAt 28213248 / 32768 => java.net.ProtocolException: unexpected end of stream

and player is throwing error because of no source I tried use another libs but i am getting the same situation.

There is 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);
    }
}

What can i do to resolve this?

0 Answers
Related