Skip to content

Commit

Permalink
Merge pull request #709 from Stremio/feat/external-moonplayer-url-sup…
Browse files Browse the repository at this point in the history
…port-for-ios

feat: ExternalPlayerLink - Add moonplayer, vlc and outplayer for visionOS
  • Loading branch information
elpiel authored Jul 31, 2024
2 parents aff290c + a618d12 commit 5e89768
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/deep_links/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pub struct OpenPlayerLink {
pub webos: Option<String>,
pub chromeos: Option<String>,
pub roku: Option<String>,
#[serde(default, skip_serializing_if = "Option::is_none")]
/// VisionOS
pub visionos: Option<String>,
}

#[derive(Default, Serialize, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -90,6 +93,7 @@ impl From<(&Stream, Option<&Url>, &Settings)> for ExternalPlayerLink {
}),
"vlc" => Some(OpenPlayerLink {
ios: Some(format!("vlc-x-callback://x-callback-url/stream?url={url}")),
visionos: Some(format!("vlc-x-callback://x-callback-url/stream?url={url}")),
android: Some(format!(
"{}#Intent;package=org.videolan.vlc;type=video;scheme=https;end",
http_regex.replace(url, "intent://"),
Expand All @@ -112,6 +116,7 @@ impl From<(&Stream, Option<&Url>, &Settings)> for ExternalPlayerLink {
}),
"outplayer" => Some(OpenPlayerLink {
ios: Some(format!("{}", http_regex.replace(url, "outplayer://"))),
visionos: Some(format!("{}", http_regex.replace(url, "outplayer://"))),
..Default::default()
}),
"infuse" => Some(OpenPlayerLink {
Expand All @@ -126,6 +131,10 @@ impl From<(&Stream, Option<&Url>, &Settings)> for ExternalPlayerLink {
macos: Some(format!("mpv://{url}")),
..Default::default()
}),
"moonplayer" => Some(OpenPlayerLink {
visionos: Some(format!("moonplayer://open?url={url}")),
..Default::default()
}),
"m3u" => Some(OpenPlayerLink {
linux: playlist.to_owned(),
windows: playlist.to_owned(),
Expand Down

0 comments on commit 5e89768

Please sign in to comment.