forked from austinried/subtracks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
43 lines (38 loc) · 1.36 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import 'react-native-gesture-handler'
import 'react-native-get-random-values'
import { enableScreens } from 'react-native-screens'
enableScreens()
import { LogBox } from 'react-native'
LogBox.ignoreLogs(["The action 'POP_TO_TOP'"])
import { AppRegistry } from 'react-native'
import App from '@app/App'
import { name as appName } from '@app/app.json'
import TrackPlayer, { Capability } from 'react-native-track-player'
AppRegistry.registerComponent(appName, () => App)
TrackPlayer.registerPlaybackService(() => require('@app/playbackservice'))
async function start() {
await TrackPlayer.setupPlayer()
await TrackPlayer.updateOptions({
capabilities: [
Capability.Play,
Capability.Pause,
Capability.Stop,
Capability.SkipToNext,
Capability.SkipToPrevious,
Capability.SeekTo,
],
compactCapabilities: [
Capability.Play, //
Capability.Pause,
Capability.SkipToNext,
Capability.SkipToPrevious,
],
playIcon: require('@res/icons/notification/ic_stat_play.png'),
pauseIcon: require('@res/icons/notification/ic_stat_pause.png'),
stopIcon: require('@res/icons/notification/ic_stat_stop.png'),
nextIcon: require('@res/icons/notification/ic_stat_next.png'),
previousIcon: require('@res/icons/notification/ic_stat_previous.png'),
icon: require('@res/icons/notification/ic_stat_play.png'),
})
}
start()