mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-04 16:56:16 +00:00
Compare commits
3 Commits
develop
...
feat/vlc-4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90474b2403 | ||
|
|
2e463ddb0c | ||
|
|
98fddcda74 |
4
app.json
4
app.json
@@ -34,7 +34,7 @@
|
|||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"jsEngine": "hermes",
|
"jsEngine": "hermes",
|
||||||
"versionCode": 89,
|
"versionCode": 90,
|
||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
"foregroundImage": "./assets/images/icon-android-plain.png",
|
"foregroundImage": "./assets/images/icon-android-plain.png",
|
||||||
"monochromeImage": "./assets/images/icon-android-themed.png",
|
"monochromeImage": "./assets/images/icon-android-themed.png",
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
"android": {
|
"android": {
|
||||||
"buildArchs": ["arm64-v8a", "x86_64"],
|
"buildArchs": ["arm64-v8a", "x86_64"],
|
||||||
"compileSdkVersion": 36,
|
"compileSdkVersion": 36,
|
||||||
"targetSdkVersion": 34,
|
"targetSdkVersion": 35,
|
||||||
"buildToolsVersion": "35.0.0",
|
"buildToolsVersion": "35.0.0",
|
||||||
"kotlinVersion": "2.0.21",
|
"kotlinVersion": "2.0.21",
|
||||||
"minSdkVersion": 24,
|
"minSdkVersion": 24,
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export const AddToFavorites: FC<Props> = ({ item, ...props }) => {
|
|||||||
<RoundButton
|
<RoundButton
|
||||||
size='large'
|
size='large'
|
||||||
icon={isFavorite ? "heart" : "heart-outline"}
|
icon={isFavorite ? "heart" : "heart-outline"}
|
||||||
|
color={isFavorite ? "purple" : "white"}
|
||||||
onPress={toggleFavorite}
|
onPress={toggleFavorite}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export const RoundButton: React.FC<PropsWithChildren<Props>> = ({
|
|||||||
<Ionicons
|
<Ionicons
|
||||||
name={icon}
|
name={icon}
|
||||||
size={size === "large" ? 22 : 18}
|
size={size === "large" ? 22 : 18}
|
||||||
color={"white"}
|
color={color === "white" ? "white" : "#9334E9"}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{children ? children : null}
|
{children ? children : null}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
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"
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,16 +63,16 @@ class VlcPlayerModule : Module() {
|
|||||||
view.seekTo(time)
|
view.seekTo(time)
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncFunction("setAudioTrack") { view: VlcPlayerView, trackIndex: Int ->
|
AsyncFunction("setAudioTrack") { view: VlcPlayerView, trackId: String ->
|
||||||
view.setAudioTrack(trackIndex)
|
view.setAudioTrack(trackId)
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncFunction("getAudioTracks") { view: VlcPlayerView ->
|
AsyncFunction("getAudioTracks") { view: VlcPlayerView ->
|
||||||
view.getAudioTracks()
|
view.getAudioTracks()
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncFunction("setSubtitleTrack") { view: VlcPlayerView, trackIndex: Int ->
|
AsyncFunction("setSubtitleTrack") { view: VlcPlayerView, trackId: String ->
|
||||||
view.setSubtitleTrack(trackIndex)
|
view.setSubtitleTrack(trackId)
|
||||||
}
|
}
|
||||||
|
|
||||||
AsyncFunction("getSubtitleTracks") { view: VlcPlayerView ->
|
AsyncFunction("getSubtitleTracks") { view: VlcPlayerView ->
|
||||||
|
|||||||
@@ -234,6 +234,7 @@ class VlcPlayerView(context: Context, appContext: AppContext) : ExpoView(context
|
|||||||
libVLC = LibVLC(context, initOptions)
|
libVLC = LibVLC(context, initOptions)
|
||||||
mediaPlayer = MediaPlayer(libVLC)
|
mediaPlayer = MediaPlayer(libVLC)
|
||||||
mediaPlayer?.attachViews(videoLayout, null, false, false)
|
mediaPlayer?.attachViews(videoLayout, null, false, false)
|
||||||
|
mediaPlayer?.setVideoScale(MediaPlayer.ScaleType.SURFACE_BEST_FIT)
|
||||||
mediaPlayer?.setEventListener(this)
|
mediaPlayer?.setEventListener(this)
|
||||||
|
|
||||||
log.debug("Loading network file: $uri")
|
log.debug("Loading network file: $uri")
|
||||||
@@ -294,38 +295,26 @@ class VlcPlayerView(context: Context, appContext: AppContext) : ExpoView(context
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setAudioTrack(trackIndex: Int) {
|
fun setAudioTrack(trackId: String) {
|
||||||
mediaPlayer?.setAudioTrack(trackIndex)
|
// 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>>? {
|
fun getAudioTracks(): List<Map<String, Any>>? {
|
||||||
log.debug("getAudioTracks ${mediaPlayer?.audioTracks}")
|
// TODO: VLC 4.0 API - need to find correct method
|
||||||
val trackDescriptions = mediaPlayer?.audioTracks ?: return null
|
log.debug("getAudioTracks - not yet implemented for VLC 4.0")
|
||||||
|
return emptyList()
|
||||||
return trackDescriptions.map { trackDescription ->
|
|
||||||
mapOf("name" to trackDescription.name, "index" to trackDescription.id)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setSubtitleTrack(trackIndex: Int) {
|
fun setSubtitleTrack(trackId: String) {
|
||||||
mediaPlayer?.setSpuTrack(trackIndex)
|
// 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>>? {
|
fun getSubtitleTracks(): List<Map<String, Any>>? {
|
||||||
val subtitleTracks = mediaPlayer?.spuTracks?.map { trackDescription ->
|
// TODO: VLC 4.0 API - need to find correct method
|
||||||
mapOf("name" to trackDescription.name, "index" to trackDescription.id)
|
log.debug("getSubtitleTracks - not yet implemented for VLC 4.0")
|
||||||
}
|
return emptyList()
|
||||||
|
|
||||||
// Debug statement to print the result
|
|
||||||
log.debug("Subtitle Tracks: $subtitleTracks")
|
|
||||||
|
|
||||||
return subtitleTracks
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setSubtitleURL(subtitleURL: String, name: String) {
|
fun setSubtitleURL(subtitleURL: String, name: String) {
|
||||||
|
|||||||
Reference in New Issue
Block a user