Commit 8e664031 authored by Carola Nitz's avatar Carola Nitz

VLCMovieViewController: Correctly display Playing Externally view

When the renderer is disconnected we want to hide the playing Externally view
When we mirror the screen we don't want to show it either so we just check if we have a renderer
parent 6256bf23
......@@ -1680,7 +1680,8 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
- (void)showOnDisplay:(UIView *)view
{
BOOL displayExternally = view != _movieView;
// 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];
[_playingExternalView updateUIWithRendererItem:_vpc.renderer];
_vpc.videoOutputView = view;
......@@ -1703,9 +1704,11 @@ currentMediaHasTrackToChooseFrom:(BOOL)currentMediaHasTrackToChooseFrom
{
// Create a renderer button for VLCMovieViewController
_rendererButton = [VLCRendererDiscovererManager.sharedInstance setupRendererButton];
[VLCRendererDiscovererManager.sharedInstance addSelectionHandlerWithSelectionHandler:^(VLCRendererItem * item) {
[VLCRendererDiscovererManager.sharedInstance addSelectionHandler:^(VLCRendererItem * item) {
if (item) {
[self showOnDisplay:_playingExternalView.displayView];
} else {
[self removedCurrentRendererItem:_vpc.renderer];
}
}];
}
......
......@@ -115,7 +115,7 @@ class VLCRendererDiscovererManager: NSObject {
}
}
@objc func addSelectionHandler(selectionHandler: ((_ rendererItem: VLCRendererItem?) -> Void)?) {
@objc func addSelectionHandler(_ selectionHandler: ((_ rendererItem: VLCRendererItem?) -> Void)?) {
actionSheet.setAction { [weak self] (item) in
if let rendererItem = item as? VLCRendererItem {
//if we select the same renderer we want to disconnect
......
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