-
Notifications
You must be signed in to change notification settings - Fork 474
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
How can i enable picture in picture in player #497
Comments
// start pip
[_player.playbackController startPictureInPicture];
// stop
// [_player.playbackController stopPictureInPicture];
// pip methods
// - (BOOL)isPictureInPictureSupported API_AVAILABLE(ios(14.0));
// @property (nonatomic) BOOL requiresLinearPlaybackInPictureInPicture API_AVAILABLE(ios(14.0));
// @property (nonatomic, readonly) SJPictureInPictureStatus pictureInPictureStatus API_AVAILABLE(ios(14.0));
// @property (nonatomic, copy, nullable) void(^restoreUserInterfaceForPictureInPictureStop)(id<SJVideoPlayerPlaybackController> controller, void(^completionHandler)(BOOL restored));
// - (void)startPictureInPicture API_AVAILABLE(ios(14.0));
// - (void)stopPictureInPicture API_AVAILABLE(ios(14.0)); |
@changsanjiang thanks brother but i need to confirm one thing how to add picture in picture icon in player currently there is no icon is showing related to pip. Thanks For Your Reply. |
@Najamus you can add a custom pip button to player or using SJVideoPlayer. (there are no such buttons on the SJBaseVideoPlayer); startImage = [AVPictureInPictureController.pictureInPictureButtonStartImage imageWithTintColor:UIColor.whiteColor];
stopImage = [AVPictureInPictureController.pictureInPictureButtonStopImage imageWithTintColor:UIColor.whiteColor]; |
i added custom button in top adapter and on its click i add this code. it always got to picture in picture not supported.
One More thing brother. Could you please share Swift File of SJFloatSmallViewTransitionController. Thanks |
HI Brother Just tell me one thing, im using SJVideoPlayer, when i enabled picture in picture in my project from capabilities now player default show picture in picture icon on top right & its working correctly. i just need to change that pip icon tint color currently it adopt application accent/tint color but i wnat to change it with white color. Thanks & Regards |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
SJVideoPlayer.updateResources{ res in
// res.progressThumbSize = 8
// res.progressTraceColor = UIColor.white
// res.progressTrackColor = UIColor(white: 0.4, alpha: 1.0)
// res.progressBufferColor = UIColor(white: 0.3, alpha: 1.0)
if #available(iOS 14.0, *) {
res.pictureInPictureItemStartImage = AVPictureInPictureController.pictureInPictureButtonStartImage.withTintColor(.red)
res.pictureInPictureItemStopImage = ...
}
}
// Override point for customization after application launch.
return true
} |
setting image color seems no effect, |
Basically i wanted to add Picture in Picture functionality in player i tried but didn't found a solution how to enable it while using this library.
Thanks & Regards
The text was updated successfully, but these errors were encountered: