Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Album Artwork not showing on IOS #399

Open
2 of 4 tasks
alcolopa opened this issue Feb 24, 2022 · 0 comments
Open
2 of 4 tasks

Album Artwork not showing on IOS #399

alcolopa opened this issue Feb 24, 2022 · 0 comments

Comments

@alcolopa
Copy link

alcolopa commented Feb 24, 2022

Hello,

I am trying to add an artwork to the media that is being played when our app is playing, we only use one artwork for all of our playing times for the meantime since it's a radio app.

The following code is used to display an icon, it works on simulator but it doesn't seem to work on a real device.

We are using a webview with a stream as a player and visualizer.

Description

I have followed the instructions for both iOS and Android and the controls work perfectly fine, I have added the capabilities needed for this package to run on the iOS Side

Code Used:

import MusicControl, { Command } from 'react-native-music-control';

const logo = 'https://i.imgur.com/e1cpwdo.png';

  componentDidMount() {
    MusicControl.enableBackgroundMode(true);
    MusicControl.handleAudioInterruptions(true);

    MusicControl.on(Command.play, () => {
      this.toggleAudio();
    })

}

  toggleAudio = () => {
    if (!this.state.isInitialized) {
      MusicControl.setNowPlaying({
        title: 'Belight FM',
        artwork: logo, // URL or RN's image require()
        artist: '105.7',
        color: 0xffffff, 
        colorized: true, 
        isLiveStream: true,
        elapsedTime: 0,
      })
      MusicControl.enableControl('play', true)
      MusicControl.enableControl('pause', true)
      MusicControl.enableControl('skipBackward', true, { interval: 10 })
      MusicControl.enableControl('skipForward', true, { interval: 10 })
      this.setState(prevState => ({
        isInitialized: !prevState.isInitialized
      }));
    }
  1. Platform ?

    • iOS
    • Android
  2. Device

  • Simulator
  • Real device
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant