Baseflow / ExoPlayerXamarin

Xamarin bindings library for the Google ExoPlayer library

Home Page:https://baseflow.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Facing a runtime error while trying to play rtmp stream

ahmad913 opened this issue · comments

commented

💬 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...

Please try again in 2.11.7