Commit 63f8a9fb authored by Carola Nitz's avatar Carola Nitz

VLCMovieViewController: fix displaying on external screen via HDMI

When we refactored we didn't pass the movieView to the external screen when displaying externally
This worked well for chromecast and mirroring but sadly not for attaching an external screen via HDMI
(closes #263)

(cherry picked from commit 10de9b62)
parent a8fbfa8e
......@@ -21,9 +21,8 @@ class VLCPlayingExternallyView: UIView {
}
var externalWindow: UIWindow?
@objc func shouldDisplay(_ show: Bool) {
@objc func shouldDisplay(_ show: Bool, movieView: UIView) {
self.isHidden = !show
externalWindow?.isHidden = !show
if show {
guard let screen = UIScreen.screens.count > 1 ? UIScreen.screens[1] : nil else {
return
......@@ -34,11 +33,14 @@ class VLCPlayingExternallyView: UIView {
return
}
externalWindow.rootViewController = VLCExternalDisplayController()
externalWindow.rootViewController?.view.addSubview(movieView)
externalWindow.screen = screen
externalWindow.rootViewController?.view.frame = externalWindow.bounds
movieView.frame = externalWindow.bounds
} else {
externalWindow = nil
}
externalWindow?.isHidden = !show
}
override func awakeFromNib() {
......
......@@ -1691,11 +1691,15 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)showOnDisplay:(UIView *)view
{
// if we don't have a renderer we're mirroring and don't want to show the dialog
BOOL displayExternally = _vpc.renderer && view != _movieView;
[_playingExternalView shouldDisplay:displayExternally];
BOOL displayExternally = view != _movieView;
[_playingExternalView shouldDisplay:displayExternally movieView:_movieView];
[_playingExternalView updateUIWithRendererItem:_vpc.renderer];
_vpc.videoOutputView = view;
_artworkImageView.hidden = displayExternally;
if (!displayExternally && _movieView.superview != self.view) {
[self.view addSubview:_movieView];
[self.view sendSubviewToBack:_movieView];
_movieView.frame = self.view.frame;
}
}
- (void)handleExternalScreenDidConnect:(NSNotification *)notification
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment