mirror of
https://github.com/Jellify-Music/App.git
synced 2026-02-05 01:48:30 -06:00
20 lines
639 B
TypeScript
20 lines
639 B
TypeScript
import TrackPlayer, { RatingType } from "react-native-track-player"
|
|
import { CAPABILITIES } from "../constants";
|
|
|
|
export const useUpdateOptions = async (isFavorite: boolean) => {
|
|
return await TrackPlayer.updateOptions({
|
|
progressUpdateEventInterval: 1,
|
|
capabilities: CAPABILITIES,
|
|
notificationCapabilities: CAPABILITIES,
|
|
compactCapabilities: CAPABILITIES,
|
|
ratingType: RatingType.Heart,
|
|
likeOptions: {
|
|
isActive: isFavorite,
|
|
title: "Favorite"
|
|
},
|
|
dislikeOptions: {
|
|
isActive: !isFavorite,
|
|
title: "Unfavorite"
|
|
}
|
|
});
|
|
} |