Open pramod7 opened 8 years ago
When you set the playerView and filterSwitchView frame you set the Width and Height to be both SCREEN_WIDTH (Which will mean you end up with a square frame).
Change this:
filterSwitcherView.frame = CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_WIDTH);
playerView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_WIDTH);
To this:
filterSwitcherView.frame = CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT);
playerView.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
But in playerView, video is displayed proper by using,
playerView.playerLayer.videoGravity = AVLayerVideoGravityResizeAspect;
as landscape Video in landscape mode, vise versa. but I am not fined anything like this when using SCSwipeableFilterView which always results video in square mode.
_I am uses this library to record video and showing it in next screen then apply filter using SCSwipeableFilterView, I am facing issue while selecting video from library, selected video only display in square mode, I am using same class here SCSwipeableFilterView.
//code uses to
player = [SCPlayer player]; player.loopEnabled = YES; player.delegate = self; [player setVolume:10]; player.autoRotate=NO; player.SCImageView = filterSwitcherView;
//**// I also tried different approach by using SCVideoPlayerView than video display fine as there respective mode (eg. landscape, portrait) but hurdle is, when I uses SCFilterImageView class apply filter its than black out comes,
//code uses
// Render the video directly through a filter SCFilterImageView *filterView = [[SCFilterImageView alloc] initWithFrame:playerView.bounds]; filterView.filter = [SCFilter filterWithCIFilterName:@"CIPhotoEffectProcess"]; [playerView addSubview:filterView];
player.SCImageView = filterView;