diff --git a/Resources/TVVLCPlayer.storyboard b/Resources/TVVLCPlayer.storyboard old mode 100644 new mode 100755 index 1410ed7..77a0434 --- a/Resources/TVVLCPlayer.storyboard +++ b/Resources/TVVLCPlayer.storyboard @@ -1,9 +1,9 @@ - + - + @@ -161,12 +161,16 @@ + + + + @@ -224,6 +228,18 @@ + + + + + + + + + + + + @@ -242,18 +258,18 @@ - + - + - + - + @@ -265,7 +281,7 @@ @@ -684,7 +700,7 @@ - + diff --git a/Sources/Panel/InfoViewController.swift b/Sources/Panel/InfoViewController.swift index dddf0fe..5795dc6 100644 --- a/Sources/Panel/InfoViewController.swift +++ b/Sources/Panel/InfoViewController.swift @@ -60,9 +60,13 @@ class InfoViewController: UIViewController { func configureTitle() { let mediaDict = player.media?.metaDictionary if let title = mediaDict?[VLCMetaInformationTitle] as? String { - titleLabel.text = title + titleLabel.text = title +// titleLabel.numberOfLines = 0 + titleLabel.lineBreakMode = NSLineBreakMode.byCharWrapping } else { - titleLabel.text = player.media?.url.absoluteString + titleLabel.text = player.media?.url.absoluteString +// titleLabel.numberOfLines = 0 + titleLabel.lineBreakMode = NSLineBreakMode.byCharWrapping } } diff --git a/Sources/Panel/SlideAnimatedTransitioner.swift b/Sources/Panel/SlideAnimatedTransitioner.swift index a23fc0b..c0fd81d 100644 --- a/Sources/Panel/SlideAnimatedTransitioner.swift +++ b/Sources/Panel/SlideAnimatedTransitioner.swift @@ -55,7 +55,7 @@ class SlideUpAnimatedTransitioner: NSObject, UIViewControllerAnimatedTransitioni delay: 0.0, usingSpringWithDamping: 1.0, initialSpringVelocity: 0.0, options: .allowUserInteraction, - animations: { secondVCView.frame.origin.y = -secondVC.preferredContentSize.height }, + animations: { secondVCView.frame.origin.y = -secondVC.preferredContentSize.height - 60 }, completion: { _ in secondVCView.removeFromSuperview() transitionContext.completeTransition(!transitionContext.transitionWasCancelled)}) diff --git a/Sources/VLCPlayerViewController.swift b/Sources/VLCPlayerViewController.swift old mode 100644 new mode 100755 index 8efb9b0..40c9ae1 --- a/Sources/VLCPlayerViewController.swift +++ b/Sources/VLCPlayerViewController.swift @@ -42,6 +42,8 @@ public class VLCPlayerViewController: UIViewController { @IBOutlet var actionGesture: LongPressGestureRecogniser! @IBOutlet var playPauseGesture: UITapGestureRecognizer! @IBOutlet var cancelGesture: UITapGestureRecognizer! + @IBOutlet var jumpForwardGesture: UITapGestureRecognizer! + @IBOutlet var jumpBackwardGesture: UITapGestureRecognizer! @IBOutlet var scrubbingPositionController: ScrubbingPositionController! @IBOutlet var remoteActionPositionController: RemoteActionPositionController! @@ -208,6 +210,13 @@ public class VLCPlayerViewController: UIViewController { player.play() hideControl() } + @IBAction func jumpForward(_ sender: Any) { + player.shortJumpForward() + } + @IBAction func jumpBackward(_ sender: Any) { + player.shortJumpBackward() + } + } // MARK: - Update views diff --git a/SwiftUIDemo/ContentView.swift b/SwiftUIDemo/ContentView.swift index fb60116..e8df391 100644 --- a/SwiftUIDemo/ContentView.swift +++ b/SwiftUIDemo/ContentView.swift @@ -17,6 +17,8 @@ struct TestTVVLCPlayerController: UIViewControllerRepresentable { let player = VLCMediaPlayer() let media: VLCMedia = VLCMedia(url: URL(string: "https://upload.wikimedia.org/wikipedia/commons/8/88/Big_Buck_Bunny_alt.webm")!) media.addOption(":http-user-agent=AppleCoreMedia/1.0.0.18L191 (Apple TV; U; CPU OS 14_5 like Mac OS X; zh_cn)") +// player.addPlaybackSlave(URL(string: "http://raw.githubusercontent.com/chinanf-boy/translate-srt/master/test.zh.srt")!, type: .subtitle, enforce: true) + player.addPlaybackSlave(URL(string: "http://raw.githubusercontent.com/chinanf-boy/translate-srt/master/test.zh.srt"), type: .subtitle, enforce: true) player.media = media let playerViewController = VLCPlayerViewController.instantiate(player: player) return playerViewController @@ -25,7 +27,7 @@ struct TestTVVLCPlayerController: UIViewControllerRepresentable { } } -struct TestPlayerView: View { +struct TestPlayerView: View { var body: some View { TestTVVLCPlayerController() .edgesIgnoringSafeArea(/*@START_MENU_TOKEN@*/.all/*@END_MENU_TOKEN@*/) diff --git a/SwiftUIDemo/Info.plist b/SwiftUIDemo/Info.plist index 16d307c..a956a1b 100644 --- a/SwiftUIDemo/Info.plist +++ b/SwiftUIDemo/Info.plist @@ -26,6 +26,11 @@ arm64 + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + UIUserInterfaceStyle Automatic diff --git a/TVVLCPlayer.xcodeproj/project.xcworkspace/xcuserdata/layne.xcuserdatad/UserInterfaceState.xcuserstate b/TVVLCPlayer.xcodeproj/project.xcworkspace/xcuserdata/layne.xcuserdatad/UserInterfaceState.xcuserstate index f45641b..6829543 100644 Binary files a/TVVLCPlayer.xcodeproj/project.xcworkspace/xcuserdata/layne.xcuserdatad/UserInterfaceState.xcuserstate and b/TVVLCPlayer.xcodeproj/project.xcworkspace/xcuserdata/layne.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/TVVLCPlayer.xcodeproj/xcuserdata/layne.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/TVVLCPlayer.xcodeproj/xcuserdata/layne.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index be0849c..fdd5254 100644 --- a/TVVLCPlayer.xcodeproj/xcuserdata/layne.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/TVVLCPlayer.xcodeproj/xcuserdata/layne.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -7,33 +7,209 @@ + + + + + + + + + startingLineNumber = "94" + endingLineNumber = "94" + landmarkName = "longPressedActionForCurrentLocation()" + landmarkType = "7"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TVVLCPlayer.xcodeproj/xcuserdata/layne.xcuserdatad/xcschemes/xcschememanagement.plist b/TVVLCPlayer.xcodeproj/xcuserdata/layne.xcuserdatad/xcschemes/xcschememanagement.plist index 5be74d9..8490d1e 100644 --- a/TVVLCPlayer.xcodeproj/xcuserdata/layne.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/TVVLCPlayer.xcodeproj/xcuserdata/layne.xcuserdatad/xcschemes/xcschememanagement.plist @@ -9,6 +9,11 @@ orderHint 1 + SwiftUIDemo.xcscheme_^#shared#^_ + + orderHint + 2 + TVVLCPlayer.xcscheme_^#shared#^_ orderHint