You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 6, 2022. It is now read-only.
Because it's necessary to call `.setNowPlaying()` for the controls to work, I've moved it before the `enableControl` section (which is not sufficient to "enable" the controls).
The `setNowPlaying` method enables the music controls. To disable them, use `resetNowPlaying()`.
56
+
57
+
You should call this method after a sound is playing.
58
+
59
+
For Android's rating system, remove the `rating` value for unrated tracks, use a boolean for RATING_HEART or RATING_THUMBS_UP_DOWN and use a number for other types.
60
+
61
+
**Note**: To use custom types, you have to define the type with `updatePlayback` before calling this function.
62
+
63
+
```javascript
64
+
MusicControl.setNowPlaying({
65
+
title:'Billie Jean',
66
+
artwork:'https://i.imgur.com/e1cpwdo.png', // URL or RN's image require()
67
+
artist:'Michael Jackson',
68
+
album:'Thriller',
69
+
genre:'Post-disco, Rhythm and Blues, Funk, Dance-pop',
70
+
duration:294, // (Seconds)
71
+
description:'', // Android Only
72
+
color:0xffffff, // Android Only - Notification Color
73
+
colorized:true, // Android 8+ Only - Notification Color extracted from the artwork. Set to false to use the color property instead
74
+
date:'1983-01-02T00:00:00Z', // Release Date (RFC 3339) - Android Only
75
+
rating:84, // Android Only (Boolean or Number depending on the type)
76
+
notificationIcon:'my_custom_icon', // Android Only (String), Android Drawable resource name for a custom notification icon
77
+
isLiveStream:true, // iOS Only (Boolean), Show or hide Live Indicator instead of seekbar on lock screen for live streams. Default value is false.
78
+
})
79
+
```
80
+
53
81
### Enable and Disable controls
54
82
55
83
**iOS**: Lockscreen
@@ -94,34 +122,6 @@ For Android, 5, 10 and 30 is fixed
94
122
95
123
For iOS, it is dynamic so any number is accepted
96
124
97
-
### Now Playing
98
-
99
-
The `setNowPlaying` method enables the music controls. To disable them, use `resetNowPlaying()`.
100
-
101
-
You should call this method after a sound is playing.
102
-
103
-
For Android's rating system, remove the `rating` value for unrated tracks, use a boolean for RATING_HEART or RATING_THUMBS_UP_DOWN and use a number for other types.
104
-
105
-
**Note**: To use custom types, you have to define the type with `updatePlayback` before calling this function.
106
-
107
-
```javascript
108
-
MusicControl.setNowPlaying({
109
-
title:'Billie Jean',
110
-
artwork:'https://i.imgur.com/e1cpwdo.png', // URL or RN's image require()
111
-
artist:'Michael Jackson',
112
-
album:'Thriller',
113
-
genre:'Post-disco, Rhythm and Blues, Funk, Dance-pop',
114
-
duration:294, // (Seconds)
115
-
description:'', // Android Only
116
-
color:0xffffff, // Android Only - Notification Color
117
-
colorized:true, // Android 8+ Only - Notification Color extracted from the artwork. Set to false to use the color property instead
118
-
date:'1983-01-02T00:00:00Z', // Release Date (RFC 3339) - Android Only
119
-
rating:84, // Android Only (Boolean or Number depending on the type)
120
-
notificationIcon:'my_custom_icon', // Android Only (String), Android Drawable resource name for a custom notification icon
121
-
isLiveStream:true, // iOS Only (Boolean), Show or hide Live Indicator instead of seekbar on lock screen for live streams. Default value is false.
122
-
})
123
-
```
124
-
125
125
### Update Playback
126
126
127
127
You don't need to set all properties when calling the `updatePlayback` method, but you should always set `elapsedTime` for iOS support and better performance on Android.
0 commit comments