From b4dcfcc425c8e47e0a6c55e4accd07471ab27491 Mon Sep 17 00:00:00 2001 From: Aiden Vigue Date: Thu, 27 May 2021 10:27:04 -0400 Subject: [PATCH 1/5] up build --- JellyfinPlayer.xcodeproj/project.pbxproj | 4 ++-- JellyfinPlayer/Info.plist | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/JellyfinPlayer.xcodeproj/project.pbxproj b/JellyfinPlayer.xcodeproj/project.pbxproj index cc9f0820..34680d80 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 = 22; + CURRENT_PROJECT_VERSION = 23; 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 = 22; + CURRENT_PROJECT_VERSION = 23; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEVELOPMENT_ASSET_PATHS = ""; DEVELOPMENT_TEAM = 9R8RREG67J; diff --git a/JellyfinPlayer/Info.plist b/JellyfinPlayer/Info.plist index afa37c36..ba1364e6 100644 --- a/JellyfinPlayer/Info.plist +++ b/JellyfinPlayer/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString $(MARKETING_VERSION) CFBundleVersion - 22 + 23 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS From 4e5a810047cd1e7e5c6095e75cdcfc4a32b4cac0 Mon Sep 17 00:00:00 2001 From: Aiden Vigue Date: Thu, 27 May 2021 10:49:17 -0400 Subject: [PATCH 2/5] Fix playback --- JellyfinPlayer/Views/VideoPlayer.swift | 35 ++++++++++++-------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/JellyfinPlayer/Views/VideoPlayer.swift b/JellyfinPlayer/Views/VideoPlayer.swift index 79f4b189..296c86bf 100644 --- a/JellyfinPlayer/Views/VideoPlayer.swift +++ b/JellyfinPlayer/Views/VideoPlayer.swift @@ -158,12 +158,21 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe //View has loaded. //Show loading screen - usleep(10000); delegate?.showLoadingView(self) mediaPlayer.perform(Selector(("setTextRendererFontSize:")), with: 14) //mediaPlayer.wrappedValue.perform(Selector(("setTextRendererFont:")), with: "Copperplate") + + mediaPlayer.delegate = self + mediaPlayer.drawable = videoContentView + + if(manifest.Type == "Episode") { + titleLabel.text = "\(manifest.Name) - S\(String(manifest.ParentIndexNumber ?? 0)):E\(String(manifest.IndexNumber ?? 0)) - \(manifest.SeriesName ?? "")" + } else { + titleLabel.text = manifest.Name + } + //Fetch max bitrate from UserDefaults depending on current connection mode let defaults = UserDefaults.standard let maxBitrate = globalData.isInNetwork ? defaults.integer(forKey: "InNetworkBandwidth") : defaults.integer(forKey: "OutOfNetworkBandwidth") @@ -258,8 +267,9 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe sendPlayReport() playbackItem = item; } - mediaPlayer.stop() + DispatchQueue.global(qos: .background).async { + mediaPlayer.media = VLCMedia(url: playbackItem.videoUrl) mediaPlayer.play() subtitleTrackArray.forEach() { sub in if(sub.id != -1 && sub.delivery == "External" && sub.codec != "subrip") { @@ -267,13 +277,11 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe mediaPlayer.addPlaybackSlave(sub.url, type: .subtitle, enforce: false) } } + mediaPlayer.pause() + delegate?.showLoadingView(self) sleep(3) mediaPlayer.pause() - usleep(10000); - mediaPlayer.play() mediaPlayer.currentVideoSubTitleIndex = selectedCaptionTrack; - mediaPlayer.pause() - usleep(10000); mediaPlayer.play() mediaPlayer.jumpForward(Int32(manifest.Progress/10000000)) } @@ -286,15 +294,6 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe break } } - - mediaPlayer.delegate = self - mediaPlayer.drawable = videoContentView - - if(manifest.Type == "Episode") { - titleLabel.text = "\(manifest.Name) - S\(String(manifest.ParentIndexNumber ?? 0)):E\(String(manifest.IndexNumber ?? 0)) - \(manifest.SeriesName ?? "")" - } else { - titleLabel.text = manifest.Name - } } override func viewWillAppear(_ animated: Bool) { @@ -308,11 +307,9 @@ class PlayerViewController: UIViewController, VLCMediaDelegate, VLCMediaPlayerDe let currentState: VLCMediaPlayerState = mediaPlayer.state switch currentState { case .stopped : - print("Video is done playing)") - sendStopReport() + break; case .ended : - print("Video is done playing)") - sendStopReport() + break; case .playing : print("Video is playing") sendProgressReport(eventName: "unpause") From 33631e7a2391fb9b84e73df9a1cb9711d8392f68 Mon Sep 17 00:00:00 2001 From: aiden Date: Thu, 27 May 2021 13:23:31 -0400 Subject: [PATCH 3/5] Update README.md --- README.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 84c84d29..18c5408a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,24 @@ -Native Jellyfin Player +

Jellyfin Native for iOS

+

Part of the Jellyfin Project

+ +--- + +

+Logo Banner +
+
+ +GPL 3.0 License + + +GitHub release (latest SemVer) + + +Chat on Matrix + +

+ +--- [Join the Discord!](https://discord.gg/WghTptH2) From bd386b4e453c4f998eb1c1cd0276c5f5e228a614 Mon Sep 17 00:00:00 2001 From: Aiden Vigue Date: Thu, 27 May 2021 13:25:20 -0400 Subject: [PATCH 4/5] Auto stash before merge of "main" and "Jellyfin/main" --- JellyfinPlayer.xcodeproj/project.pbxproj | 4 + JellyfinPlayer/Views/VideoPlayer.storyboard | 25 ++-- JellyfinPlayer/Views/VideoPlayer.swift | 39 ++++- .../Views/VideoPlayerSettingsView.swift | 135 ++++++++++++++++++ 4 files changed, 190 insertions(+), 13 deletions(-) create mode 100644 JellyfinPlayer/Views/VideoPlayerSettingsView.swift diff --git a/JellyfinPlayer.xcodeproj/project.pbxproj b/JellyfinPlayer.xcodeproj/project.pbxproj index 34680d80..89f68696 100644 --- a/JellyfinPlayer.xcodeproj/project.pbxproj +++ b/JellyfinPlayer.xcodeproj/project.pbxproj @@ -40,6 +40,7 @@ 53E4E647263F6CF100F67C6B /* LibraryFilterView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53E4E646263F6CF100F67C6B /* LibraryFilterView.swift */; }; 53E4E649263F725B00F67C6B /* MultiSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53E4E648263F725B00F67C6B /* MultiSelector.swift */; }; 53EE24E6265060780068F029 /* LibrarySearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EE24E5265060780068F029 /* LibrarySearchView.swift */; }; + 53F8377D265FF67C00F456B3 /* VideoPlayerSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53F8377C265FF67C00F456B3 /* VideoPlayerSettingsView.swift */; }; 53FF7F2A263CF3F500585C35 /* LatestMediaView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53FF7F29263CF3F500585C35 /* LatestMediaView.swift */; }; AE8C3154265D60BF008AA076 /* SettingsModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8C3153265D60BF008AA076 /* SettingsModel.swift */; }; AE8C3156265D616A008AA076 /* SettingsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AE8C3155265D616A008AA076 /* SettingsViewModel.swift */; }; @@ -99,6 +100,7 @@ 53E4E646263F6CF100F67C6B /* LibraryFilterView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibraryFilterView.swift; sourceTree = ""; }; 53E4E648263F725B00F67C6B /* MultiSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MultiSelector.swift; sourceTree = ""; }; 53EE24E5265060780068F029 /* LibrarySearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LibrarySearchView.swift; sourceTree = ""; }; + 53F8377C265FF67C00F456B3 /* VideoPlayerSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoPlayerSettingsView.swift; sourceTree = ""; }; 53FF7F29263CF3F500585C35 /* LatestMediaView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LatestMediaView.swift; sourceTree = ""; }; AE8C3153265D60BF008AA076 /* SettingsModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsModel.swift; sourceTree = ""; }; AE8C3155265D616A008AA076 /* SettingsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsViewModel.swift; sourceTree = ""; }; @@ -198,6 +200,7 @@ 535BAEA4264A151C005FA86D /* VideoPlayer.swift */, 539B2DA4263BA5B8007FF1A4 /* SettingsView.swift */, 53313B8F265EEA6D00947AA3 /* VideoPlayer.storyboard */, + 53F8377C265FF67C00F456B3 /* VideoPlayerSettingsView.swift */, ); path = Views; sourceTree = ""; @@ -322,6 +325,7 @@ 5377CBFE263B596B003A4E83 /* PersistenceController.swift in Sources */, 5389276E263C25100035E14B /* ContinueWatchingView.swift in Sources */, 535BAE9F2649E569005FA86D /* ItemView.swift in Sources */, + 53F8377D265FF67C00F456B3 /* VideoPlayerSettingsView.swift in Sources */, 53987CA426572C1300E7EA70 /* SeasonItemView.swift in Sources */, 53192D5D265AA78A008A4215 /* DeviceProfileBuilder.swift in Sources */, AE8C3154265D60BF008AA076 /* SettingsModel.swift in Sources */, diff --git a/JellyfinPlayer/Views/VideoPlayer.storyboard b/JellyfinPlayer/Views/VideoPlayer.storyboard index 6cc32c7b..d4b80988 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 @@