mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
Workaround for AVPlayerView being unavailable on 32-bit OSX
This commit is contained in:
parent
0508e4f2fe
commit
276d760cb5
1 changed files with 11 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue