Skip to content

Commit

Permalink
Bug Fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
iosparesh committed May 27, 2019
1 parent c593470 commit c03414f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions SAVideoPlayer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 = (
Expand All @@ -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 = (
Expand Down
6 changes: 3 additions & 3 deletions SAVideoPlayer/Source/ViewVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -630,17 +630,17 @@ 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
let timeRange = CMTimeRangeMake(start: CMTime.zero, duration: CMTime(seconds: duration.seconds, preferredTimescale: 1))
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)
Expand Down

0 comments on commit c03414f

Please sign in to comment.