Browse Source

Workaround for AVPlayerView being unavailable on 32-bit OSX

tags/2021-05-28
jules 8 years ago
parent
commit
276d760cb5
1 changed files with 11 additions and 1 deletions
  1. +11
    -1
      modules/juce_video/native/juce_mac_Video.h

+ 11
- 1
modules/juce_video/native/juce_mac_Video.h View File

@@ -34,7 +34,15 @@ struct VideoComponent::Pimpl : public BaseClass
{
setVisible (true);
#if JUCE_MAC
#if JUCE_MAC && JUCE_32BIT
auto view = [[NSView alloc] init]; // 32-bit builds don't have AVPlayerView, so need to use a layer
controller = [[AVPlayerLayer alloc] init];
setView (view);
[view setNextResponder: [view superview]];
[view setWantsLayer: YES];
[view setLayer: controller];
[view release];
#elif JUCE_MAC
controller = [[AVPlayerView alloc] init];
setView (controller);
[controller setNextResponder: [controller superview]];
@@ -174,6 +182,8 @@ struct VideoComponent::Pimpl : public BaseClass
private:
#if JUCE_IOS
AVPlayerViewController* controller = nil;
#elif JUCE_32BIT
AVPlayerLayer* controller = nil;
#else
AVPlayerView* controller = nil;
#endif


Loading…
Cancel
Save