-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem in Playing video in UITableView when full screen (landscape video only) #6
Comments
Hi @aanaipandi22. has the table view controller rotated? Please refer to this issue for configuration rotation. changsanjiang/SJVideoPlayer#148 |
Hi, |
Hi @aanaipandi22 , try these codes below: @implementation AppDelegate
- (UIInterfaceOrientationMask)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return UIInterfaceOrientationMaskAll;
}
@end
@implementation YourTableViewController
- (BOOL)shouldAutorotate {
return NO;
}
@end
@implementation UITabBarController (RotationControl)
- (UIViewController *)sj_topViewController {
if ( self.selectedIndex == NSNotFound )
return self.viewControllers.firstObject;
return self.selectedViewController;
}
- (BOOL)shouldAutorotate {
return [[self sj_topViewController] shouldAutorotate];
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return [[self sj_topViewController] supportedInterfaceOrientations];
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return [[self sj_topViewController] preferredInterfaceOrientationForPresentation];
}
@end
@implementation UINavigationController (RotationControl)
- (BOOL)shouldAutorotate {
return self.topViewController.shouldAutorotate;
}
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return self.topViewController.supportedInterfaceOrientations;
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
return self.topViewController.preferredInterfaceOrientationForPresentation;
}
- (nullable UIViewController *)childViewControllerForStatusBarStyle {
return self.topViewController;
}
- (nullable UIViewController *)childViewControllerForStatusBarHidden {
return self.topViewController;
}
@end |
Dear sir,
I am using the latest version 3.0.0. Problem in playing video in UITableView when the full screen button clicked only if the video orientation is landscape. If the video orientation is portrait, not a problem. Only for landscape orientation video only.
Initially I have 15 elements in the tableview array.
I also enabled the autoplay function.
Indexpath=0 , also not a problem.
Playing landscape video in portrait mode at indexpath=1, then I click the full screen button then the device automatically rotate to landscape mode. Now Player not playing the first index video, immediately it call the delegate method -(void)sj_playerNeedPlayNewAssetAtIndexPath:(NSIndexPath). Now the new indexpath is 11, player playing the 11 index video. But I want to play first index video only.
After clicking the full screen button, the tableview visible index path array has the value of index path 11,12. But currently I am in index path 1 only.
I tested in XCode 11.0, Simulator iPhone 8 (iOS 13)
What is the problem?
The text was updated successfully, but these errors were encountered: