mirror of
https://github.com/kalarina-bit/Fogwave.git
synced 2026-11-22 08:06:09 +00:00
Release 1.0.13
- Add LRT Radijas, Žinių radijas, Latvijas Radio 1 and Latvijas Radio 2 - Add HLS playback (media3-exoplayer-hls) for the Latvijas Radio streams - Add "News & talk" and "Latvian music" genres - Show the view options button on the Radio tab only; Favorites uses the same layout - Update descriptions and changelogs Inspired by https://github.com/JacobBico/fogwave-baltic
This commit is contained in:
@@ -5,12 +5,15 @@ import android.content.Context
|
||||
import androidx.core.net.toUri
|
||||
import androidx.media3.common.MediaItem
|
||||
import androidx.media3.common.MediaMetadata
|
||||
import androidx.media3.common.MimeTypes
|
||||
import cc.skysparkle.fogwave.data.model.RadioStation
|
||||
|
||||
fun RadioStation.toMediaItem(context: Context): MediaItem {
|
||||
val artworkUri = "${ContentResolver.SCHEME_ANDROID_RESOURCE}://${context.packageName}/$iconResId".toUri()
|
||||
return MediaItem.Builder()
|
||||
.setUri(streamUrl)
|
||||
// HLS playlists are picked up by the HLS module; everything else stays a progressive stream.
|
||||
.apply { if (streamUrl.substringBefore('?').endsWith(".m3u8")) setMimeType(MimeTypes.APPLICATION_M3U8) }
|
||||
.setMediaId(id)
|
||||
.setMediaMetadata(
|
||||
MediaMetadata.Builder()
|
||||
|
||||
Reference in New Issue
Block a user