From fa885e1f76cdbee6bfb435f5ef6e19b80a89432d Mon Sep 17 00:00:00 2001 From: Aiden Vigue Date: Thu, 27 May 2021 00:31:31 -0400 Subject: [PATCH] rst of build 22 --- JellyfinPlayer.xcodeproj/project.pbxproj | 4 +- JellyfinPlayer/ContinueWatchingView.swift | 1 - JellyfinPlayer/Info.plist | 2 +- JellyfinPlayer/LatestMediaView.swift | 1 - JellyfinPlayer/NextUpView.swift | 1 - JellyfinPlayer/Views/VideoPlayer.storyboard | 44 ++++++++++----------- JellyfinPlayer/Views/VideoPlayer.swift | 38 +++++++++--------- 7 files changed, 43 insertions(+), 48 deletions(-) diff --git a/JellyfinPlayer.xcodeproj/project.pbxproj b/JellyfinPlayer.xcodeproj/project.pbxproj index 4dc90f18..cc9f0820 100644 --- a/JellyfinPlayer.xcodeproj/project.pbxproj +++ b/JellyfinPlayer.xcodeproj/project.pbxproj @@ -474,7 +474,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = 9R8RREG67J; ENABLE_BITCODE = NO; @@ -500,7 +500,7 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 20; + CURRENT_PROJECT_VERSION = 22; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = 9R8RREG67J; diff --git a/JellyfinPlayer/ContinueWatchingView.swift b/JellyfinPlayer/ContinueWatchingView.swift index 569ee357..95f695bc 100644 --- a/JellyfinPlayer/ContinueWatchingView.swift +++ b/JellyfinPlayer/ContinueWatchingView.swift @@ -172,7 +172,6 @@ struct ContinueWatchingView: View { }.padding(.trailing, 5) } } - Spacer().frame(width:12) }.frame(height: 215) } else { EmptyView() diff --git a/JellyfinPlayer/Info.plist b/JellyfinPlayer/Info.plist index 2026a01a..afa37c36 100644 --- a/JellyfinPlayer/Info.plist +++ b/JellyfinPlayer/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - $(CURRENT_PROJECT_VERSION) + 22 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/JellyfinPlayer/LatestMediaView.swift b/JellyfinPlayer/LatestMediaView.swift index 0c3d3c16..210fe1f3 100644 --- a/JellyfinPlayer/LatestMediaView.swift +++ b/JellyfinPlayer/LatestMediaView.swift @@ -143,7 +143,6 @@ struct LatestMediaView: View { } Spacer().frame(width: 14) } - Spacer().frame(width:14) }.frame(height: 190) }.onAppear(perform: onAppear).padding(EdgeInsets(top: -2, leading: 0, bottom: 0, trailing: 0)).frame(height: 190) } diff --git a/JellyfinPlayer/NextUpView.swift b/JellyfinPlayer/NextUpView.swift index e32242c6..a5117f18 100644 --- a/JellyfinPlayer/NextUpView.swift +++ b/JellyfinPlayer/NextUpView.swift @@ -106,7 +106,6 @@ struct NextUpView: View { } Spacer().frame(width: 10) } - Spacer().frame(width:14) } }.frame(height: 200) }.padding(EdgeInsets(top: -2, leading: 0, bottom: 0, trailing: 0)).frame(height: 200) diff --git a/JellyfinPlayer/Views/VideoPlayer.storyboard b/JellyfinPlayer/Views/VideoPlayer.storyboard index 4e5729ca..6cc32c7b 100644 --- a/JellyfinPlayer/Views/VideoPlayer.storyboard +++ b/JellyfinPlayer/Views/VideoPlayer.storyboard @@ -1,6 +1,6 @@ - + @@ -14,10 +14,10 @@ - + - + @@ -26,10 +26,10 @@ - + - + @@ -39,7 +39,7 @@ - + + + - - @@ -191,7 +191,7 @@ - + diff --git a/JellyfinPlayer/Views/VideoPlayer.swift b/JellyfinPlayer/Views/VideoPlayer.swift index 22dd4e75..79f4b189 100644 --- a/JellyfinPlayer/Views/VideoPlayer.swift +++ b/JellyfinPlayer/Views/VideoPlayer.swift @@ -31,7 +31,6 @@ struct AudioTrack { class PlaybackItem: ObservableObject { @Published var videoType: VideoType = .hls; @Published var videoUrl: URL = URL(string: "https://example.com")!; - @Published var subtitles: [Subtitle] = []; } protocol PlayerViewControllerDelegate: AnyObject { @@ -44,7 +43,7 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe weak var delegate: PlayerViewControllerDelegate? - var mediaPlayer = VLCMediaPlayer(options: ["--sub-margin=-50"])! + var mediaPlayer = VLCMediaPlayer() var globalData = GlobalData() @IBOutlet weak var timeText: UILabel! @@ -224,7 +223,6 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe } self.sendPlayReport() - item.subtitles = subtitleTrackArray playbackItem = item; } else { print("Direct playing!"); @@ -258,27 +256,27 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe } sendPlayReport() - item.subtitles = subtitleTrackArray playbackItem = item; } - - mediaPlayer.media = VLCMedia(url: playbackItem.videoUrl) - playbackItem.subtitles.forEach() { sub in - if(sub.id != -1 && sub.delivery == "External" && sub.codec != "subrip") { - mediaPlayer.addPlaybackSlave(sub.url, type: .subtitle, enforce: false) + mediaPlayer.stop() + DispatchQueue.global(qos: .background).async { + mediaPlayer.play() + subtitleTrackArray.forEach() { sub in + if(sub.id != -1 && sub.delivery == "External" && sub.codec != "subrip") { + print("adding subs for id: \(sub.id) w/ url: \(sub.url)") + mediaPlayer.addPlaybackSlave(sub.url, type: .subtitle, enforce: false) + } } + sleep(3) + mediaPlayer.pause() + usleep(10000); + mediaPlayer.play() + mediaPlayer.currentVideoSubTitleIndex = selectedCaptionTrack; + mediaPlayer.pause() + usleep(10000); + mediaPlayer.play() + mediaPlayer.jumpForward(Int32(manifest.Progress/10000000)) } - mediaPlayer.play() - mediaPlayer.currentVideoSubTitleIndex = -1; - mediaPlayer.currentAudioTrackIndex = selectedAudioTrack; - mediaPlayer.pause() - usleep(10000); - mediaPlayer.play() - usleep(10000); - mediaPlayer.pause() - usleep(10000); - mediaPlayer.play() - mediaPlayer.jumpForward(Int32(manifest.Progress/10000000)) } catch { }