Notification of progress bar from the video player keeps permanently loading

Using the Android SDK for implementing the video player, it seems to have a strange behaviour when a video is playing.

It doesn’t say explicitly bitmovin playing, just the name of the app that the video player is currently implemented.

I want to know why this is happening and also how can be removed, from the SDK examples there’s one example about controlling notification, however is not fully helpful to what the issue we are tackling with.

Hi @carrerafandres2496,

whats your setup here? Did you implement PlayerNotificationManager?

Hi @anon63174557

This is the main player setup, I didn’t implement PlayerNotificationManager but I was thinking of implementing in order to deactivate the notification.

    @SuppressLint("ResourceType")
    @NonNull
    @Override
    protected PlayerView createViewInstance(@NonNull ThemedReactContext reactContext) {
        _reactContext = reactContext;
        StyleConfig styleConfig = new StyleConfig();
        styleConfig.setPlayerUiJs("file:///android_asset/bitmovin-ui.js");
        styleConfig.setPlayerUiCss("file:///android_asset/bitmovin-ui.css");
        _playerConfig.setStyleConfig(styleConfig);
        _player = Player.create(reactContext, _playerConfig);
        _playerView = new PlayerView(reactContext, _player);
        _playerView.setUiVisible(true);
        _playerView.setCustomMessageHandler(customMessageHandler);
        setListeners();
        return _playerView;
    }

Thanks. Where do you setup the PlayerConfig? I assume background playback is configured or did you bind a service for handling (background)playback? Afaik this notification should only display once a PlayerNotificationManager is used (or any other implementation of MediaSession. The BitmovinPlayer usually does not present a Notification per default.

Or are you using offline functionality with a DownloadService in scenario shown? Hard to tell from the image :wink:

This snippet code contains where actually the playerConfig is setup:

  @ReactProp(name = "configuration")
    public void setConfiguration(PlayerView view, ReadableMap config) {
        _offlineSourceConfig = null;
        ReadableMap styleMap = null;
        ReadableMap playbackMap = null;
        Source source;
        _sourceConfig = null;
        if (config.getString("offlineSourceConfig") != null) {
            Gson gson = new Gson();
            _offlineSourceConfig = gson.fromJson(config.getString("offlineSourceConfig"), OfflineSourceConfig.class);
        } else if (config.getString("url") != null) {
            _sourceConfig = new SourceConfig(Objects.requireNonNull(config.getString("url")),
                    SourceType.Dash);
        } else {
            throw new IllegalArgumentException("cannot read null from url and offlineSourceConfig properties");
        }

        if (config.getString("title") != null) {
            _sourceConfig.setTitle(Objects.requireNonNull(config.getString("title")));
        }
        // it would be useful when passing the thumbnail
        if (config.getString("thumbnailUrl") != null) {
            _sourceConfig.setThumbnailTrack(
                    new ThumbnailTrack(Objects.requireNonNull(config.getString("thumbnailUrl"))));
        }
        if (config.hasKey("style")) {
            styleMap = config.getMap("style");
        }
        if (styleMap != null) {
            if (styleMap.hasKey("fullscreenIcon") && styleMap.getBoolean("fullscreenIcon")) {
                CustomFullscreenHandler customFullscreenHandler = new CustomFullscreenHandler(
                        Objects.requireNonNull(_reactContext.getCurrentActivity()),
                        _playerView);
                _playerView.setFullscreenHandler(customFullscreenHandler);
            }
            if (styleMap.hasKey("uiEnabled") && !styleMap.getBoolean("uiEnabled")) {
                _playerView.setUiVisible(false);
            }
        }

        if (config.hasKey("playback")) {
            playbackMap = config.getMap("playback");
        }
        if (playbackMap != null) {
            if (playbackMap.hasKey("autoPlay") && playbackMap.getBoolean("autoPlay")) {
                if (_playerView != null) {
                    _playbackConfig.setAutoplayEnabled(true);
                    _playerConfig.setPlaybackConfig(_playbackConfig);
                }
            }
        }
        if (_offlineSourceConfig != null) {
            source = Source.create(_offlineSourceConfig);
        } else {
            source = Source.create(_sourceConfig);
        }
        _player.load(source);
    }

I configured the playback as shown on the script above, I haven’t got any other service to handle the playback or neither background playback.

However I have a DownloadModule which is the manager for downloading service, the setup of this module is highly linked to issue Can I use the Android SDK to download videos from a source that has no internet access? - #7 by peder.borg as it was a issue we were struggling with, but I think this provisional setup affects the Bitmovin notifications manager, because