Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

version 2.8.4 still not support RTSP? #4679

Closed
fukemy opened this issue Aug 18, 2018 · 1 comment
Closed

version 2.8.4 still not support RTSP? #4679

fukemy opened this issue Aug 18, 2018 · 1 comment
Assignees

Comments

@fukemy
Copy link

fukemy commented Aug 18, 2018

hello. I can not play rtsp url using hero and mediaType HSL.

 Context context = JZVideoPlayerManager.getCurrentJzvd().getContext();

        DefaultBandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();

        TrackSelection.Factory videoTrackSelectionFactory =
                new AdaptiveTrackSelection.Factory(bandwidthMeter);
//
        TrackSelector trackSelector =
                new DefaultTrackSelector(videoTrackSelectionFactory);

//        LoadControl loadControl = new DefaultLoadControl(new DefaultAllocator(true, C.DEFAULT_BUFFER_SEGMENT_SIZE),
//                360000, 600000, 1000, 5000,
//                C.LENGTH_UNSET,
//                false);

        LoadControl loadControl = new DefaultLoadControl.Builder().createDefaultLoadControl();
        // 2. Create the player

        RenderersFactory renderersFactory = new DefaultRenderersFactory(context);
        simpleExoPlayer = ExoPlayerFactory.newSimpleInstance(renderersFactory, trackSelector, loadControl);
        // Produces DataSource instances through which media data is loaded.
        DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(context,
                Util.getUserAgent(context, context.getResources().getString(R.string.app_name)));

        String currUrl = currentDataSource.toString();

        videoSource = new HlsMediaSource.Factory(dataSourceFactory)
                .createMediaSource(Uri.parse(currUrl));

        simpleExoPlayer.addVideoListener(this);

        Log.e(TAG, "URL Link = " + currUrl);

        simpleExoPlayer.addListener(this);

        simpleExoPlayer.prepare(videoSource);
        simpleExoPlayer.setPlayWhenReady(true);

here is the log output:

08-18 23:10:58.059 10184-10426/com.futurisx.icamera E/JZExoPlayer: prepare
08-18 23:10:58.256 10184-10426/com.futurisx.icamera E/JZExoPlayer: URL Link = rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov
08-18 23:10:58.260 10184-10426/com.futurisx.icamera E/JZExoPlayer: onPlayerStateChanged2/ready=false
08-18 23:10:58.262 10184-10426/com.futurisx.icamera E/JZExoPlayer: onPlayerStateChanged2/ready=true
08-18 23:10:58.269 10184-10426/com.futurisx.icamera E/JZExoPlayer: setSurface
08-18 23:10:58.270 10184-10426/com.futurisx.icamera E/JZExoPlayer: onTimelineChanged
08-18 23:10:58.368 10184-10426/com.futurisx.icamera E/JZExoPlayer: onLoadingChanged
08-18 23:11:01.408 10184-10452/com.futurisx.icamera E/ExoPlayerImplInternal: Source error.
    com.google.android.exoplayer2.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov
        at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:194)
        at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147)
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:841)
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:308)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
        at java.lang.Thread.run(Thread.java:764)
     Caused by: java.net.MalformedURLException: unknown protocol: rtsp
        at java.net.URL.<init>(URL.java:597)
        at java.net.URL.<init>(URL.java:487)
        at java.net.URL.<init>(URL.java:436)
        at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:341)
        at com.google.android.exoplayer2.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:192)
        at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147) 
        at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:841) 
        at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:308) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) 
        at java.lang.Thread.run(Thread.java:764) 
08-18 23:11:01.413 10184-10426/com.futurisx.icamera E/JZExoPlayer: onPlayerErrorcom.google.android.exoplayer2.ExoPlaybackException
08-18 23:11:01.414 10184-10426/com.futurisx.icamera E/JZExoPlayer: onLoadingChanged
08-18 23:11:01.416 10184-10426/com.futurisx.icamera E/JZExoPlayer: onPlayerStateChanged1/ready=true
08-18 23:11:01.421 10184-10184/com.futurisx.icamera E/JiaoZiVideoPlayer: onError 1000 - 1000 [40997727] 
@ojw28
Copy link
Contributor

ojw28 commented Aug 19, 2018

ExoPlayer does not currently support RTSP. This enhancement is tracked by #55.

@ojw28 ojw28 closed this as completed Aug 19, 2018
@ojw28 ojw28 self-assigned this Aug 19, 2018
@google google locked and limited conversation to collaborators Dec 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants