Slackbot
12/10/2024, 3:30 PMmarkturnip
12/11/2024, 7:22 AMmarkturnip
12/11/2024, 7:22 AMmarkturnip
12/11/2024, 7:22 AMyoussef hachicha
12/11/2024, 8:12 AMoverride fun convertToMediaItem(path: String, url: String): MediaItem {
return if (path.startsWith("https://")) {
val audioUrl = NSURL.URLWithString(path) ?: NSURL(string = path)
AVPlayerItem(uRL = audioUrl)
} else {
if (fileManager.fileExistsAtPath(path)) {
AVPlayerItem(uRL = NSURL.fileURLWithPath(path))
} else {
val audioUrl = NSURL.URLWithString(url) ?: NSURL(string = url)
AVPlayerItem(uRL = audioUrl)
}
}
}
at the end of the dropBox link, there is dl=0 this ensures that the link is not downloadable if set to dl=1 I will be able to download it
I tried passing both, you can even add .mp3 at the end of the link, but it didn't work.markturnip
12/12/2024, 2:40 AMmarkturnip
12/12/2024, 2:41 AM