Giter Site home page Giter Site logo

Comments (7)

sviataslau avatar sviataslau commented on July 21, 2024

The code is pretty simple.
Layout

<io.vov.vitamio.widget.CenterLayout
    android:id="@+id/dd"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <io.vov.vitamio.widget.VideoView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_centerInParent="true"
        android:id="@+id/videoView" />
</io.vov.vitamio.widget.CenterLayout>

Activity

void setupVideoView() {
    if (!LibsChecker.checkVitamioLibs(this))
        return;
    videoView.setKeepScreenOn(true);
    videoView.setVideoURI(Uri.parse(url));
    mediaController = new MediaController(this);
    mediaController.setAnchorView(videoView);
    videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
        @Override
        public void onCompletion(MediaPlayer mediaPlayer) {
            finish();
        }
    });
    videoView.setOnErrorListener(new MediaPlayer.OnErrorListener() {
        @Override
        public boolean onError(MediaPlayer mediaPlayer, int i, int i2) {
            Toast.makeText(EpisodeVideoActivity.this, getString(R.string.loading_error) + " Код ошибки: " + Integer.toString(i) + " / " +  Integer.toString(i2), Toast.LENGTH_LONG).show();
            return true;
        }
    });
    videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
        @Override
        public void onPrepared(MediaPlayer mediaPlayer) {
            videoView.setMediaController(mediaController);
            mediaController.setFileName(title);
            videoView.setTimedTextShown(true);
            progress.setVisibility(View.GONE);
        }
    });
    videoView.setOnTimedTextListener(new MediaPlayer.OnTimedTextListener() {
        @Override
        public void onTimedText(String text) {
            subtitles.setText(text);
        }

        @Override
        public void onTimedTextUpdate(byte[] pixels, int width, int height) {

        }
    });

    videoView.requestFocus();
    videoView.Start();
}

from vitamiobundle.

crossle avatar crossle commented on July 21, 2024

If you test use VitamioDemo?

from vitamiobundle.

sviataslau avatar sviataslau commented on July 21, 2024

Just ran VitamioBundle on device and got another error with code -2.

Here is the logcat.

09-23 13:34:29.982: INFO/VitamioPlayer: OPEN FILE VideoView.setVideoURI(Uri.parse("https://dl.dropboxusercontent.com/u/7622874/Fucking%20shame/Video%2004.02.12%2C%2022%2018%2009.mov"));
09-23 13:34:29.982: ERROR/VitamioPlayer: avformat_open_input: No such file or directory : -2
09-23 13:34:29.982: DEBUG/VitamioPlayer: CLEAN START
09-23 13:34:29.982: ERROR/VitamioPlayer: error (1, -2)
09-23 13:34:29.982: INFO/VitamioPlayer: FILE CLOSE BEGIN
09-23 13:34:29.982: INFO/VitamioPlayer: FREE VIDEOPIC BEGIN
09-23 13:34:29.982: INFO/VitamioPlayer: FREE VIDEOPIC 2 END
09-23 13:34:29.982: INFO/VitamioPlayer: FREE SUBPIC BEGIN
09-23 13:34:29.982: INFO/VitamioPlayer: FREE SUBPIC 1 END
09-23 13:34:29.982: INFO/VitamioPlayer: FREE AUDIOFRAME BEGIN
09-23 13:34:29.982: INFO/VitamioPlayer: FREE AUDIOFRAME 8 END
09-23 13:34:29.982: INFO/VitamioPlayer: DELETE GLOBAL REF BEGIN
09-23 13:34:29.982: INFO/VitamioPlayer: DELETE GLOBAL REF END
09-23 13:34:29.982: INFO/VitamioPlayer: FILE CLOSE END
09-23 13:34:29.982: DEBUG/VitamioPlayer: CLEAN END
09-23 13:34:29.982: INFO/VitamioPlayer: THREAD PREPARE DETTACHED
09-23 13:34:29.982: INFO/VitamioPlayer: THREAD PREPARE END
09-23 13:34:30.082: INFO/ActivityManager(516): Displayed io.vov.vitamio.demo/.VideoViewDemo: +344ms
09-23 13:34:30.082: ERROR/VitamioPlayer: Error (1, -2)
09-23 13:34:30.082: DEBUG/VitamioPlayer: Error: 1, -2

from vitamiobundle.

crossle avatar crossle commented on July 21, 2024

Try use other link? local file or http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8

from vitamiobundle.

sviataslau avatar sviataslau commented on July 21, 2024

Finally I got my device and now I can see proper logcat for actual -5 error.
Before error I have strange messages:
E/Vitamio[Player]﹕ [tls @ 0x7491e450] error:1411809D:SSL routines:SSL_CHECK_SERVERHELLO_TLSEXT:tls invalid ecpointformat list
E/Vitamio[Player]﹕ avformat_open_input: I/O error : -5.
I fixed it changing url from https to http, but VPlayer plays the same URL fine even on HTTPS connection.

from vitamiobundle.

crossle avatar crossle commented on July 21, 2024

SSL bug, We'll update Openssl

from vitamiobundle.

crossle avatar crossle commented on July 21, 2024

Fixed on Vitamio 4.2.0

from vitamiobundle.

Related Issues (20)

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.