Closed ajay2c9 closed 6 years ago
For the position bar
Take a look in the example app at the VideoTrimmerViewController: https://github.com/prynt/PryntTrimmerView/blob/master/Example/PryntTrimmerView/VideoTrimmerViewController.swift
It uses a timer to check regularly the currentTime of the player:
let playBackTime = player.currentTime()
trimmerView.seek(to: playBackTime)
Please check the VideoTrimmerViewController for a complete implementation.
For the startTime and endTime: Can you please put a breakPoint inside the AVAssetTimeSelector
class, in the method getTime(from position: CGFloat)
, and check the values for the following:
durationSize
Hi, I am using the PryntTrimmerView in my app my project is in objective-c and i am using Xcode 8.3.3. I am facing a problem position bar . Position bar is not moving. I implemented the code like this.After downloading the video from URL in to local path, i call a method in that
trimView.handleColor = [UIColor whiteColor]; trimView.mainColor = [UIColor darkGrayColor]; trimView.positionBarColor = [UIColor whiteColor]; [trimView setMinDuration:4.0]; [trimView setMaxDuration:25.0]; seekBarView.hidden=NO; trimView.hidden=NO; FBVideoAsset = [AVAsset assetWithURL:[NSURL fileURLWithPath:filePath isDirectory:YES]]; trimView.asset =FBVideoAsset; trimView.delegate=self;
FBVideoItem =[[AVPlayerItem alloc]initWithAsset:FBVideoAsset]; fbVideoPlayer=nil; fbVideoPlayer = [[AVPlayer alloc]initWithPlayerItem:FBVideoItem]; AVPlayerLayer *playerLayer = [AVPlayerLayer playerLayerWithPlayer:fbVideoPlayer]; fbPlayerView.backgroundColor=[UIColor clearColor]; [playerLayer removeFromSuperlayer]; [fbPlayerView.layer addSublayer:playerLayer]; playerLayer.contentsGravity = AVLayerVideoGravityResizeAspectFill; [playerLayer setFrame:trimVCDelegate.fbPlayerView.frame]; [fbPlayerView.layer addSublayer:playerLayer]; [fbVideoPlayer play];
Delegate methods are calling when left and right handles are moving. Start and end points are also not getting. please give suggestion for moving the position bar while playing the video and getting the Start and end points values.
Thank you