0

I have literally tried everything, but I can't get my SubRip-subtitles to work in Vitamio. Is it maybe because subtitles aren't supported whilst streaming videos? I'd like to know. English Vitamio support sucks.

Here's what I've come up with:

    public class StreamVideoActivity extends FragmentActivity implements OnSubtitleUpdateListener {
        //Variables
        VideoView streamingVideo;
        TextView subtitleText;

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

            subtitleText = (TextView) findViewById(R.id.subText);
            streamingVideo = (VideoView) findViewById(R.id.videoView);

            //BLABLABLABLA

            streamingVideo.setVideoPath(fileUrl);
            streamingVideo.setVideoQuality(MediaPlayer.VIDEOQUALITY_HIGH);
            streamingVideo.setMediaController(mediaController);
            streamingVideo.setBufferSize(512);
            streamingVideo.setOnPreparedListener(new OnPreparedListener(){

                @Override
                public void onPrepared(MediaPlayer arg0) {
                    streamingVideo.setSubPath(subtitleFile.getPath());
                    streamingVideo.setSubShown(true);
                    streamingVideo.setSubEncoding(null);
                    streamingVideo.setSubTrack(MediaPlayer.SUBTITLE_EXTERNAL);
                    streamingVideo.setOnSubtitleUpdateListener(this);
                    streamingVideo.start();
                }
            }
        }
        @Override
        public void onSubtitleUpdate(final String arg0) {
            if (arg0 != null) {
                handler.post(new Runnable() {
                    @Override
                    public void run() {
                        subtitleText.setText(arg0);
                    }
                });
            }
        }

        @Override
        public void onSubtitleUpdate(byte[] arg0, int arg1, int arg2) {
            // TODO Auto-generated method stub

        }
    }
Esoteric Screen Name
  • 6,082
  • 4
  • 29
  • 38
  • if you literally tried everything, i don't see how an answer can be provided... – njzk2 Jul 10 '13 at 15:16
  • Well, I literally tried everything I could think of. – Bram De Backer Jul 10 '13 at 16:56
  • what are the symptoms? do you get anything at all in `onSubtitleUpdate` ? on in the other `onSubtitleUpdate` ? since you don't specify an encoding, it would make sense that the method with the `byte[]` is called rather than the one with the string. I would test : A/ put an encoding in `setSubEncoding`. B/ Log what happens in `onSubtitleUpdate(byte[] ...` – njzk2 Jul 11 '13 at 07:39
  • When SubEncoding is set to null, it should automatically detect the encoding. In LogCat it recognises the SubRip format. I'll see what happens in OnSubtitleUpdate(byte[]...). Thanks – Bram De Backer Jul 11 '13 at 08:09

1 Answers1

0

You can download VitamioBundle, vitamio-sample had a sample for subtitle support.

Crossle Song
  • 10,104
  • 2
  • 29
  • 38