ghenry22 / cordova-plugin-music-controls2

A Cordova plugin displaying music controls in notifications (cordova-plugin-music-controls)
MIT License
59 stars 60 forks source link

cordova-plugin-music-controls2 for streaming #101

Open massimilianocom opened 7 months ago

massimilianocom commented 7 months ago

From what I read, it's a nice plugin but very little is explained about everything. For example, can it work for audio streaming such as web radio? Is it possible to dynamically change the artist name, song title and how? Can the covers be taken online or only locally?

pinguluk commented 4 months ago

For example, can it work for audio streaming such as web radio?

Yes, just pass the information here

MusicControls.create({
    track       : 'Time is Running Out',        // optional, default : ''
    artist      : 'Muse',                       // optional, default : ''
    album       : 'Absolution',     // optional, default: ''
    cover       : 'albums/absolution.jpg',      // optional, default : nothing
    // cover can be a local path (use fullpath 'file:///storage/emulated/...', or only 'my_image.jpg' if my_image.jpg is in the www folder of your app)
    //           or a remote url ('http://...', 'https://...', 'ftp://...')

 

Is it possible to dynamically change the artist name, song title and how?

Just call the create method again, but with the new info

 

Can the covers be taken online or only locally?

Both

MusicControls.create({
    ...
    cover       : 'albums/absolution.jpg',      // optional, default : nothing
    // cover can be a local path (use fullpath 'file:///storage/emulated/...', or only 'my_image.jpg' if my_image.jpg is in the www folder of your app)
    //           or a remote url ('http://...', 'https://...', 'ftp://...')