Compare commits

...

3 Commits

Author SHA1 Message Date
Fredrik Burmester
90474b2403 fix(android): building and video playing with correct aspect ratio 2026-01-05 11:52:00 +01:00
Fredrik Burmester
2e463ddb0c chore: version 2026-01-05 10:06:34 +01:00
Fredrik Burmester
98fddcda74 fix: item content header button colors 2026-01-05 10:06:29 +01:00
6 changed files with 22 additions and 32 deletions

View File

@@ -34,7 +34,7 @@
},
"android": {
"jsEngine": "hermes",
"versionCode": 89,
"versionCode": 90,
"adaptiveIcon": {
"foregroundImage": "./assets/images/icon-android-plain.png",
"monochromeImage": "./assets/images/icon-android-themed.png",
@@ -63,7 +63,7 @@
"android": {
"buildArchs": ["arm64-v8a", "x86_64"],
"compileSdkVersion": 36,
"targetSdkVersion": 34,
"targetSdkVersion": 35,
"buildToolsVersion": "35.0.0",
"kotlinVersion": "2.0.21",
"minSdkVersion": 24,

View File

@@ -16,6 +16,7 @@ export const AddToFavorites: FC<Props> = ({ item, ...props }) => {
<RoundButton
size='large'
icon={isFavorite ? "heart" : "heart-outline"}
color={isFavorite ? "purple" : "white"}
onPress={toggleFavorite}
/>
</View>

View File

@@ -104,7 +104,7 @@ export const RoundButton: React.FC<PropsWithChildren<Props>> = ({
<Ionicons
name={icon}
size={size === "large" ? 22 : 18}
color={"white"}
color={color === "white" ? "white" : "#9334E9"}
/>
) : null}
{children ? children : null}

View File

@@ -35,7 +35,7 @@ android {
}
dependencies {
implementation 'org.videolan.android:libvlc-all:3.6.0'
implementation 'org.videolan.android:libvlc-all:4.0.0-eap23'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
}

View File

@@ -63,16 +63,16 @@ class VlcPlayerModule : Module() {
view.seekTo(time)
}
AsyncFunction("setAudioTrack") { view: VlcPlayerView, trackIndex: Int ->
view.setAudioTrack(trackIndex)
AsyncFunction("setAudioTrack") { view: VlcPlayerView, trackId: String ->
view.setAudioTrack(trackId)
}
AsyncFunction("getAudioTracks") { view: VlcPlayerView ->
view.getAudioTracks()
}
AsyncFunction("setSubtitleTrack") { view: VlcPlayerView, trackIndex: Int ->
view.setSubtitleTrack(trackIndex)
AsyncFunction("setSubtitleTrack") { view: VlcPlayerView, trackId: String ->
view.setSubtitleTrack(trackId)
}
AsyncFunction("getSubtitleTracks") { view: VlcPlayerView ->

View File

@@ -234,6 +234,7 @@ class VlcPlayerView(context: Context, appContext: AppContext) : ExpoView(context
libVLC = LibVLC(context, initOptions)
mediaPlayer = MediaPlayer(libVLC)
mediaPlayer?.attachViews(videoLayout, null, false, false)
mediaPlayer?.setVideoScale(MediaPlayer.ScaleType.SURFACE_BEST_FIT)
mediaPlayer?.setEventListener(this)
log.debug("Loading network file: $uri")
@@ -294,38 +295,26 @@ class VlcPlayerView(context: Context, appContext: AppContext) : ExpoView(context
}
}
fun setAudioTrack(trackIndex: Int) {
mediaPlayer?.setAudioTrack(trackIndex)
fun setAudioTrack(trackId: String) {
// TODO: VLC 4.0 API - need to find correct method
log.debug("setAudioTrack called with $trackId - not yet implemented for VLC 4.0")
}
fun getAudioTracks(): List<Map<String, Any>>? {
log.debug("getAudioTracks ${mediaPlayer?.audioTracks}")
val trackDescriptions = mediaPlayer?.audioTracks ?: return null
return trackDescriptions.map { trackDescription ->
mapOf("name" to trackDescription.name, "index" to trackDescription.id)
}
// TODO: VLC 4.0 API - need to find correct method
log.debug("getAudioTracks - not yet implemented for VLC 4.0")
return emptyList()
}
fun setSubtitleTrack(trackIndex: Int) {
mediaPlayer?.setSpuTrack(trackIndex)
fun setSubtitleTrack(trackId: String) {
// TODO: VLC 4.0 API - need to find correct method
log.debug("setSubtitleTrack called with $trackId - not yet implemented for VLC 4.0")
}
// fun getSubtitleTracks(): List<Map<String, Any>>? {
// return mediaPlayer?.getSpuTracks()?.map { trackDescription ->
// mapOf("name" to trackDescription.name, "index" to trackDescription.id)
// }
// }
fun getSubtitleTracks(): List<Map<String, Any>>? {
val subtitleTracks = mediaPlayer?.spuTracks?.map { trackDescription ->
mapOf("name" to trackDescription.name, "index" to trackDescription.id)
}
// Debug statement to print the result
log.debug("Subtitle Tracks: $subtitleTracks")
return subtitleTracks
// TODO: VLC 4.0 API - need to find correct method
log.debug("getSubtitleTracks - not yet implemented for VLC 4.0")
return emptyList()
}
fun setSubtitleURL(subtitleURL: String, name: String) {