diff --git a/EZPlayer.podspec b/EZPlayer.podspec index eee66c4..290a849 100644 --- a/EZPlayer.podspec +++ b/EZPlayer.podspec @@ -93,7 +93,7 @@ Pod::Spec.new do |s| # s.source_files = "EZPlayer/*" - s.exclude_files = "EZPlayerExample/*", "EZPlayerExample_RN/*" + s.exclude_files = "EZPlayerExample/*", "EZPlayerExample_RN/*", "EZPlayer/*.plist" # s.public_header_files = "Classes/**/*.h" diff --git a/EZPlayer.xcodeproj/project.pbxproj b/EZPlayer.xcodeproj/project.pbxproj index 6e9bd4e..9f28527 100644 --- a/EZPlayer.xcodeproj/project.pbxproj +++ b/EZPlayer.xcodeproj/project.pbxproj @@ -58,9 +58,9 @@ 99C221DC1DDCB4EB00167DBE /* EZPlayerContentItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99C221DB1DDCB4EB00167DBE /* EZPlayerContentItem.swift */; }; 99CF4D691E06B43200798ACE /* EZPlayerAudibleLegibleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99CF4D671E06B43200798ACE /* EZPlayerAudibleLegibleViewController.swift */; }; 99CF4D6A1E06B43200798ACE /* EZPlayerAudibleLegibleViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 99CF4D681E06B43200798ACE /* EZPlayerAudibleLegibleViewController.xib */; }; - 99EB8CB01E0FFEEC00176BF2 /* EZPlayerWindowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99EB8CAF1E0FFEEC00176BF2 /* EZPlayerWindowView.swift */; }; 99EB8CB21E0FFF0300176BF2 /* EZPlayerWindowView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 99EB8CB11E0FFF0300176BF2 /* EZPlayerWindowView.xib */; }; A6C56C692544114100BD9654 /* EZPlayerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6C56C682544114000BD9654 /* EZPlayerDelegate.swift */; }; + A6D956302547B83B002D8A2D /* EZPlayerWindowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A6D9562F2547B83B002D8A2D /* EZPlayerWindowView.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -92,9 +92,9 @@ 99C221DB1DDCB4EB00167DBE /* EZPlayerContentItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EZPlayerContentItem.swift; sourceTree = ""; }; 99CF4D671E06B43200798ACE /* EZPlayerAudibleLegibleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EZPlayerAudibleLegibleViewController.swift; sourceTree = ""; }; 99CF4D681E06B43200798ACE /* EZPlayerAudibleLegibleViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EZPlayerAudibleLegibleViewController.xib; sourceTree = ""; }; - 99EB8CAF1E0FFEEC00176BF2 /* EZPlayerWindowView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = EZPlayerWindowView.swift; path = ../../../Downloads/EZPlayerWindowView.swift; sourceTree = ""; }; 99EB8CB11E0FFF0300176BF2 /* EZPlayerWindowView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = EZPlayerWindowView.xib; sourceTree = ""; }; A6C56C682544114000BD9654 /* EZPlayerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EZPlayerDelegate.swift; sourceTree = ""; }; + A6D9562F2547B83B002D8A2D /* EZPlayerWindowView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EZPlayerWindowView.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -195,7 +195,7 @@ children = ( 995E79271DD9A2E9006CE7E9 /* EZPlayerControlView.swift */, 995E79291DD9A322006CE7E9 /* EZPlayerControlView.xib */, - 99EB8CAF1E0FFEEC00176BF2 /* EZPlayerWindowView.swift */, + A6D9562F2547B83B002D8A2D /* EZPlayerWindowView.swift */, 99EB8CB11E0FFF0300176BF2 /* EZPlayerWindowView.xib */, ); name = Skin; @@ -327,6 +327,7 @@ buildActionMask = 2147483647; files = ( 9933B2051DFEFA920066A09A /* EZPlayerThumbnail.swift in Sources */, + A6D956302547B83B002D8A2D /* EZPlayerWindowView.swift in Sources */, 995D47AC1DFFB0B400BEB41B /* EZPlayerWindowContainerRootViewController.swift in Sources */, 99818A681DE948D1000DAC1C /* EZPlayerNotification.swift in Sources */, 99C221DC1DDCB4EB00167DBE /* EZPlayerContentItem.swift in Sources */, @@ -336,7 +337,6 @@ 99C221D81DDCAC5400167DBE /* EZPlayerTransport.swift in Sources */, 995E79281DD9A2E9006CE7E9 /* EZPlayerControlView.swift in Sources */, 99B999761E2763BA00DBC4AA /* AVPlayer+EZPlayer.swift in Sources */, - 99EB8CB01E0FFEEC00176BF2 /* EZPlayerWindowView.swift in Sources */, 99998A261DE3450700296EDB /* Timer+EZPlayer.swift in Sources */, 99C221DA1DDCAEEA00167DBE /* EZPlayerTransportExtension.swift in Sources */, A6C56C692544114100BD9654 /* EZPlayerDelegate.swift in Sources */, diff --git a/EZPlayer.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/EZPlayer.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings index 6b30c74..f9b0d7c 100644 --- a/EZPlayer.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ b/EZPlayer.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -2,8 +2,6 @@ - BuildSystemType - Original PreviewsEnabled diff --git a/EZPlayer/EZPlayerFloatView.swift b/EZPlayer/EZPlayerFloatView.swift deleted file mode 100644 index e214b55..0000000 --- a/EZPlayer/EZPlayerFloatView.swift +++ /dev/null @@ -1,69 +0,0 @@ -// -// EZPlayerFloatView.swift -// EZPlayer -// -// Created by yangjun zhu on 2016/12/28. -// Copyright © 2016年 yangjun zhu. All rights reserved. -// - -import UIKit - -open class EZPlayerWindowView: UIView, EZPlayerCustomAction { - public var autohidedControlViews = [UIView]() - - - /* - // Only override draw() if you perform custom drawing. - // An empty implementation adversely affects performance during animation. - override func draw(_ rect: CGRect) { - // Drawing code - } - */ - - weak public var player: EZPlayer? - public func playPauseButtonPressed(_ sender: Any){ - } - public func fullEmbeddedScreenButtonPressed(_ sender: Any){ - } - public func audioSubtitleCCButtonPressed(_ sender: Any){ - } - - @IBAction public func backButtonPressed(_ sender: Any){ - guard let player = self.player else { - return - } - let displayMode = player.displayMode - if displayMode == .float { - if player.lastDisplayMode == .embedded{ - player.toEmbedded() - }else if player.lastDisplayMode == .fullscreen{ - player.toFull() - } - } - self.player?.backButtonBlock?(.float) - } - - @IBAction public func closeButtonPressed(_ sender: Any){ - self.player?.stop() - } - -} - - -extension EZPlayerWindowView: EZPlayerGestureRecognizer { - - public func player(_ player: EZPlayer, singleTapGestureTapped singleTap: UITapGestureRecognizer) - { - if player.isPlaying { - player.pause() - }else{ - player.play() - } - } - - public func player(_ player: EZPlayer, doubleTapGestureTapped doubleTap: UITapGestureRecognizer) { - player.toFull() - } - - -} diff --git a/EZPlayer/EZPlayerWindowView.swift b/EZPlayer/EZPlayerWindowView.swift index e214b55..56c34ea 100644 --- a/EZPlayer/EZPlayerWindowView.swift +++ b/EZPlayer/EZPlayerWindowView.swift @@ -10,24 +10,30 @@ import UIKit open class EZPlayerWindowView: UIView, EZPlayerCustomAction { public var autohidedControlViews = [UIView]() - - - /* - // Only override draw() if you perform custom drawing. - // An empty implementation adversely affects performance during animation. - override func draw(_ rect: CGRect) { - // Drawing code - } - */ - - weak public var player: EZPlayer? + + @IBOutlet weak var backButton: UIButton! + + override open func awakeFromNib() { + super.awakeFromNib() + + } + + weak public var player: EZPlayer?{ + didSet { + if let _ = player?.scrollView{ + self.backButton.isHidden = true + }else{ + self.backButton.isHidden = false + } + } + } public func playPauseButtonPressed(_ sender: Any){ } public func fullEmbeddedScreenButtonPressed(_ sender: Any){ } public func audioSubtitleCCButtonPressed(_ sender: Any){ } - + @IBAction public func backButtonPressed(_ sender: Any){ guard let player = self.player else { return @@ -42,16 +48,16 @@ open class EZPlayerWindowView: UIView, EZPlayerCustomAction { } self.player?.backButtonBlock?(.float) } - + @IBAction public func closeButtonPressed(_ sender: Any){ self.player?.stop() } - + } extension EZPlayerWindowView: EZPlayerGestureRecognizer { - + public func player(_ player: EZPlayer, singleTapGestureTapped singleTap: UITapGestureRecognizer) { if player.isPlaying { @@ -60,10 +66,10 @@ extension EZPlayerWindowView: EZPlayerGestureRecognizer { player.play() } } - + public func player(_ player: EZPlayer, doubleTapGestureTapped doubleTap: UITapGestureRecognizer) { player.toFull() } - - + + } diff --git a/EZPlayerExample/EZPlayerExample.xcodeproj/project.pbxproj b/EZPlayerExample/EZPlayerExample.xcodeproj/project.pbxproj index 7b090c8..ed24fee 100644 --- a/EZPlayerExample/EZPlayerExample.xcodeproj/project.pbxproj +++ b/EZPlayerExample/EZPlayerExample.xcodeproj/project.pbxproj @@ -14,8 +14,6 @@ 99145C571E16685400891B06 /* VideosTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99145C561E16685400891B06 /* VideosTableViewController.swift */; }; 9914922B1DDBDA5F005FF2BD /* MediaManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9914922A1DDBDA5F005FF2BD /* MediaManager.swift */; }; 9914922D1DDBDF79005FF2BD /* MediaItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9914922C1DDBDF79005FF2BD /* MediaItem.swift */; }; - 9914922E1DDBF442005FF2BD /* EZPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 995E794E1DD9A404006CE7E9 /* EZPlayer.framework */; }; - 991595E21DE5D97B00D3CA1F /* EZPlayer.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 995E794E1DD9A404006CE7E9 /* EZPlayer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 99453E071DE41F5100BBF2FB /* hubblecast.m4v in Resources */ = {isa = PBXBuildFile; fileRef = 99453E061DE41F5100BBF2FB /* hubblecast.m4v */; }; 99504F811DE6C3BF00E1058D /* testVideo-0.ts in Resources */ = {isa = PBXBuildFile; fileRef = 99504F7E1DE6C3BF00E1058D /* testVideo-0.ts */; }; 99504F821DE6C3BF00E1058D /* testVideo-1.ts in Resources */ = {isa = PBXBuildFile; fileRef = 99504F7F1DE6C3BF00E1058D /* testVideo-1.ts */; }; @@ -27,16 +25,11 @@ 99C1A2C71DDB46510096A543 /* TabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99C1A2C61DDB46510096A543 /* TabBarController.swift */; }; 99C1A2C91DDBC8EF0096A543 /* NavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99C1A2C81DDBC8EF0096A543 /* NavigationController.swift */; }; 99C1A2CD1DDBC9870096A543 /* ParamsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 99C1A2CC1DDBC9870096A543 /* ParamsViewController.swift */; }; + A621363B2547B4240083F70C /* EZPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 995E794E1DD9A404006CE7E9 /* EZPlayer.framework */; }; + A621363C2547B4240083F70C /* EZPlayer.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 995E794E1DD9A404006CE7E9 /* EZPlayer.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 991595E31DE5D97B00D3CA1F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 995E79491DD9A403006CE7E9 /* EZPlayer.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 995E79161DD99D5A006CE7E9; - remoteInfo = EZPlayer; - }; 995E794D1DD9A404006CE7E9 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 995E79491DD9A403006CE7E9 /* EZPlayer.xcodeproj */; @@ -44,7 +37,7 @@ remoteGlobalIDString = 995E79171DD99D5A006CE7E9; remoteInfo = EZPlayer; }; - 995E794F1DD9A41A006CE7E9 /* PBXContainerItemProxy */ = { + A62136382547B41C0083F70C /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 995E79491DD9A403006CE7E9 /* EZPlayer.xcodeproj */; proxyType = 1; @@ -54,13 +47,13 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ - 991595E51DE5D97B00D3CA1F /* Embed Frameworks */ = { + A621363D2547B4240083F70C /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; dstPath = ""; dstSubfolderSpec = 10; files = ( - 991595E21DE5D97B00D3CA1F /* EZPlayer.framework in Embed Frameworks */, + A621363C2547B4240083F70C /* EZPlayer.framework in Embed Frameworks */, ); name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -96,7 +89,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 9914922E1DDBF442005FF2BD /* EZPlayer.framework in Frameworks */, + A621363B2547B4240083F70C /* EZPlayer.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -130,6 +123,7 @@ 995E79491DD9A403006CE7E9 /* EZPlayer.xcodeproj */, 995E79361DD9A3CF006CE7E9 /* EZPlayerExample */, 995E79351DD9A3CF006CE7E9 /* Products */, + A621363A2547B4240083F70C /* Frameworks */, ); sourceTree = ""; }; @@ -170,6 +164,13 @@ name = Products; sourceTree = ""; }; + A621363A2547B4240083F70C /* Frameworks */ = { + isa = PBXGroup; + children = ( + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -180,13 +181,12 @@ 995E79301DD9A3CF006CE7E9 /* Sources */, 995E79311DD9A3CF006CE7E9 /* Frameworks */, 995E79321DD9A3CF006CE7E9 /* Resources */, - 991595E51DE5D97B00D3CA1F /* Embed Frameworks */, + A621363D2547B4240083F70C /* Embed Frameworks */, ); buildRules = ( ); dependencies = ( - 995E79501DD9A41A006CE7E9 /* PBXTargetDependency */, - 991595E41DE5D97B00D3CA1F /* PBXTargetDependency */, + A62136392547B41C0083F70C /* PBXTargetDependency */, ); name = EZPlayerExample; productName = EZPlayerExample; @@ -289,15 +289,10 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 991595E41DE5D97B00D3CA1F /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = EZPlayer; - targetProxy = 991595E31DE5D97B00D3CA1F /* PBXContainerItemProxy */; - }; - 995E79501DD9A41A006CE7E9 /* PBXTargetDependency */ = { + A62136392547B41C0083F70C /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = EZPlayer; - targetProxy = 995E794F1DD9A41A006CE7E9 /* PBXContainerItemProxy */; + targetProxy = A62136382547B41C0083F70C /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -433,7 +428,6 @@ 995E79471DD9A3CF006CE7E9 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; @@ -454,7 +448,6 @@ 995E79481DD9A3CF006CE7E9 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_IDENTITY = "iPhone Developer: yangjun zhu (8NM4W5ZF88)"; DEVELOPMENT_TEAM = "";