adrielcafe/AndroidStreamable

error when playing video via exomedia

krushnaal-pai opened this issue · 1 comments

ive executed AndroidStreamable sample app as it is and as mentioned in tip, im using exomedia for playing videos

My exampleGetVideo() function

        String shortCode = "z7sw";
        AndroidStreamable.getVideo(shortCode, new VideoCallback() {
            @Override
            public void onSuccess(int statusCode, Video video) {
                emVideoView.setOnPreparedListener(MainActivity.this);
                emVideoView.setVideoURI(Uri.parse(video.getUrl()));
            }

            @Override
            public void onFailure(int statusCode, Throwable error) {
                error.printStackTrace();
            }
        });

In MainActivity.class


    @Override
    public void onPrepared() {
        emVideoView.start();
    }

When I run the app, I get below error on line emVideoView.start()

cafe.adriel.androidstreamable.sample E/ExoPlayerImplInternal: Internal track renderer error.
com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.extractor.ExtractorSampleSource$UnrecognizedInputFormatException: None of the available extractors (WebmExtractor, FragmentedMp4Extractor, Mp4Extractor, Mp3Extractor, AdtsExtractor, TsExtractor, FlvExtractor, OggExtractor, PsExtractor, WavExtractor) could read the stream.
                                                                                                 at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:262)
                                                                                                 at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:148)
                                                                                                 at com.google.android.exoplayer.ExoPlayerImplInternal.incrementalPrepareInternal(ExoPlayerImplInternal.java:273)
                                                                                                 at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:203)
                                                                                                 at android.os.Handler.dispatchMessage(Handler.java:98)
                                                                                                 at android.os.Looper.loop(Looper.java:135)
                                                                                                 at android.os.HandlerThread.run(HandlerThread.java:61)
                                                                                                 at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)

I've resolved this issue.. my bad I didn't see official api docs

String url = video.getFiles().get("mp4-mobile").getUrl();
emVideoView.setVideoURI(Uri.parse(url));