Baseflow / ExoPlayerXamarin

Xamarin bindings library for the Google ExoPlayer library
https://baseflow.com
MIT License
153 stars 67 forks source link

Facing a runtime error while trying to play rtmp stream #104

Closed ahmad913 closed 4 years ago

ahmad913 commented 4 years ago

💬 Questions and Help

Hi, i'm facing an error caused in run time after trying to play rtmp stream the error : Java.Lang.NoClassDefFoundError: 'Failed resolution of: Lnet/butterflytv/rtmp_client/RtmpClient;'

i think i'm not using the correct factory for the rtmp but i'm not sure how to do it :/ tried to copy the code from the github page and edit it afterwards but it is not going well a snippet from my code:

        SimpleExoPlayer _player;
        var mediaUri = Android.Net.Uri.Parse("rtmp://live.restream.io/live/xxxxxxxxxxxxxxxxxx");

        var defaultBandwidthMeter = new DefaultBandwidthMeter();
        var adaptiveTrackSelectionFactory = new AdaptiveTrackSelection.Factory(defaultBandwidthMeter);
        var defaultTrackSelector = new DefaultTrackSelector(adaptiveTrackSelectionFactory);

        _player = ExoPlayerFactory.NewSimpleInstance(ApplicationContext, defaultTrackSelector);

        PlayerView playerView = FindViewById<PlayerView>(Resource.Id.simple_player);
        playerView.Player = _player;

        RtmpDataSourceFactory rtmpDataSourceFactory = new RtmpDataSourceFactory();
        var videoSource = new ExtractorMediaSource(mediaUri, rtmpDataSourceFactory, new DefaultExtractorsFactory(), null, null);

        _player.Prepare(videoSource);
        _player.PlayWhenReady = true;

i tried a couple of changes to the videoSource but not working any idea about why this is happening or how to find it out ? if more info is needed i can provide it asap...

martijn00 commented 4 years ago

Please try again in 2.11.7