From c03414f4b9e7bdb5af067cda6be5604e51aa6c0f Mon Sep 17 00:00:00 2001 From: Paresh Prajapati Date: Mon, 27 May 2019 13:50:58 +0530 Subject: [PATCH] Bug Fixing --- SAVideoPlayer.xcodeproj/project.pbxproj | 10 ++++++++++ SAVideoPlayer/Source/ViewVideo.swift | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/SAVideoPlayer.xcodeproj/project.pbxproj b/SAVideoPlayer.xcodeproj/project.pbxproj index 96cd80d..0c416a3 100644 --- a/SAVideoPlayer.xcodeproj/project.pbxproj +++ b/SAVideoPlayer.xcodeproj/project.pbxproj @@ -467,6 +467,11 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/SAVideoPlayer", + "$(PROJECT_DIR)", + ); INFOPLIST_FILE = SAVideoPlayer/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( @@ -485,6 +490,11 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_STYLE = Automatic; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PROJECT_DIR)/SAVideoPlayer", + "$(PROJECT_DIR)", + ); INFOPLIST_FILE = SAVideoPlayer/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_RUNPATH_SEARCH_PATHS = ( diff --git a/SAVideoPlayer/Source/ViewVideo.swift b/SAVideoPlayer/Source/ViewVideo.swift index e3e4600..d68a074 100644 --- a/SAVideoPlayer/Source/ViewVideo.swift +++ b/SAVideoPlayer/Source/ViewVideo.swift @@ -630,7 +630,7 @@ public class ViewVideo : UIView if self.isEmbeddedVideo{ return } - guard let duration = player?.currentItem?.duration else{ + guard let duration = self.player?.currentItem?.duration else{ return } self.player?.rate = rate @@ -638,9 +638,9 @@ public class ViewVideo : UIView let composition = AVMutableComposition() do{ try composition.insertTimeRange(timeRange, - of: (player?.currentItem!.asset)!, + of: (self.player?.currentItem!.asset)!, at: CMTime.zero) - composition.scaleTimeRange(timeRange, toDuration: CMTimeMultiplyByFloat64((player?.currentItem?.asset.duration)!, multiplier: Float64(1.0 / rate))) + composition.scaleTimeRange(timeRange, toDuration: CMTimeMultiplyByFloat64((self.player?.currentItem?.asset.duration)!, multiplier: Float64(1.0 / rate))) } catch let error{ print(error.localizedDescription)