Commit f1c56224 authored by Gleb Pinigin's avatar Gleb Pinigin Committed by Felix Paul Kühne

Replace navigation bar with translucent toolbar in player

Signed-off-by: Felix Paul Kühne's avatarFelix Paul Kühne <fkuehne@videolan.org>
parent 714f9097
......@@ -12,7 +12,6 @@
{
VLCMediaPlayer *_mediaPlayer;
UIView *_movieView;
UIView *_tabBarView;
UIBarButtonItem * _backButton;
UISlider *_positionSlider;
UIBarButtonItem *_timeDisplay;
......@@ -22,6 +21,7 @@
UIButton *_subtitleSwitcherButton;
UIButton *_audioSwitcherButton;
UIView *_controllerPanel;
UIToolbar *_toolbar;
BOOL _controlsHidden;
......@@ -30,7 +30,6 @@
}
@property (nonatomic, retain) IBOutlet UIView * movieView;
@property (nonatomic, retain) IBOutlet UIView * tapBarView;
@property (nonatomic, retain) IBOutlet UIBarButtonItem * backButton;
@property (nonatomic, retain) IBOutlet UISlider * positionSlider;
@property (nonatomic, retain) IBOutlet UIBarButtonItem * timeDisplay;
......@@ -39,6 +38,7 @@
@property (nonatomic, retain) IBOutlet UIButton * fwdButton;
@property (nonatomic, retain) IBOutlet UIButton * subtitleSwitcherButton;
@property (nonatomic, retain) IBOutlet UIButton * audioSwitcherButton;
@property (nonatomic, retain) IBOutlet UIToolbar * toolbar;
@property (nonatomic, retain) IBOutlet UIView * controllerPanel;
@property (strong, nonatomic) MLFile *mediaItem;
......
......@@ -15,13 +15,15 @@
@end
@implementation VLCMovieViewController
@synthesize movieView=_movieView, tapBarView=_tapBarView, backButton=_backButton, positionSlider=_positionSlider, timeDisplay=_timeDisplay, playPauseButton = _playPauseButton, bwdButton = _bwdButton, fwdButton = _fwdButton, subtitleSwitcherButton = _subtitleSwitcherButton, audioSwitcherButton = _audioSwitcherButton, controllerPanel = _controllerPanel;
@synthesize movieView=_movieView, backButton=_backButton, positionSlider=_positionSlider, timeDisplay=_timeDisplay, playPauseButton = _playPauseButton, bwdButton = _bwdButton, fwdButton = _fwdButton, subtitleSwitcherButton = _subtitleSwitcherButton, audioSwitcherButton = _audioSwitcherButton;
@synthesize toolbar = _toolbar, controllerPanel = _controllerPanel;
- (void)dealloc
{
[_mediaItem release];
[_masterPopoverController release];
[_externalWindow release];
[_toolbar release];
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
}
......@@ -42,13 +44,11 @@
- (void)viewDidLoad
{
[super viewDidLoad];
self.wantsFullScreenLayout = YES;
_mediaPlayer = [[VLCMediaPlayer alloc] init];
[_mediaPlayer setDelegate:self];
[_mediaPlayer setDrawable:self.movieView];
self.navigationItem.leftBarButtonItem = self.backButton;
self.navigationItem.titleView = self.positionSlider;
self.navigationItem.rightBarButtonItem = self.timeDisplay;
self.navigationItem.rightBarButtonItem.style = UIBarButtonItemStylePlain;
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
[center addObserver:self selector:@selector(handleExternalScreenDidConnect:)
......@@ -70,6 +70,8 @@
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:YES animated:YES];
if (self.mediaItem) {
self.title = [self.mediaItem title];
......@@ -80,12 +82,12 @@
[UIApplication sharedApplication].idleTimerDisabled = YES;
}
self.tapBarView.hidden = NO;
self.tapBarView.alpha = 1.0f;
}
- (void)viewWillDisappear:(BOOL)animated
{
[self.navigationController setNavigationBarHidden:NO animated:YES];
[_mediaPlayer pause];
[UIApplication sharedApplication].idleTimerDisabled = NO;
[super viewWillDisappear:animated];
......
......@@ -2,10 +2,10 @@
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1552</int>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.SystemVersion">12C3104</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<string key="IBDocument.AppKitVersion">1187.34</string>
<string key="IBDocument.HIToolboxVersion">625.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">2083</string>
......@@ -14,7 +14,6 @@
<string>IBProxyObject</string>
<string>IBUIBarButtonItem</string>
<string>IBUIButton</string>
<string>IBUILabel</string>
<string>IBUISlider</string>
<string>IBUIToolbar</string>
<string>IBUIView</string>
......@@ -42,10 +41,11 @@
<object class="IBUIView" id="991208409">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{320, 548}</string>
<array class="NSMutableArray" key="NSSubviews"/>
<string key="NSFrameSize">{320, 568}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<reference key="NSNextKeyView" ref="831191623"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
......@@ -53,60 +53,9 @@
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIToolbar" id="831191623">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">266</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUISlider" id="334977839">
<reference key="NSNextResponder" ref="831191623"/>
<int key="NSvFlags">290</int>
<string key="NSFrame">{{66, 11}, {194, 23}}</string>
<reference key="NSSuperview" ref="831191623"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="644225698"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSHuggingPriority">{250, 250}</string>
<bool key="IBUIOpaque">NO</bool>
<object class="IBUIAccessibilityConfiguration" key="IBUIAccessibilityConfiguration">
<integer value="512" key="IBUIAccessibilityTraits"/>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<float key="IBUIValue">0.5</float>
</object>
</array>
<string key="NSFrameSize">{320, 44}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="334977839"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<array class="NSMutableArray" key="IBUIItems">
<object class="IBUIBarButtonItem" id="717140598">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIStyle">1</int>
<reference key="IBUIToolbar" ref="831191623"/>
<int key="IBUISystemItemIdentifier">0</int>
</object>
<object class="IBUIBarButtonItem" id="283005401">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUICustomView" ref="334977839"/>
<reference key="IBUIToolbar" ref="831191623"/>
</object>
<object class="IBUIBarButtonItem" id="776984111">
<string key="IBUITitle">--:--</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUIToolbar" ref="831191623"/>
</object>
</array>
</object>
<object class="IBUIView" id="644225698">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">292</int>
<int key="NSvFlags">269</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIButton" id="133336185">
<reference key="NSNextResponder" ref="644225698"/>
......@@ -230,7 +179,7 @@
<string key="NSFrame">{{261, 20}, {44, 44}}</string>
<reference key="NSSuperview" ref="644225698"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="991208409"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<reference key="IBUIBackgroundColor" ref="119528819"/>
<bool key="IBUIOpaque">NO</bool>
......@@ -250,23 +199,74 @@
<reference key="IBUIFont" ref="389950768"/>
</object>
</array>
<string key="NSFrame">{{-2, 298}, {325, 83}}</string>
<string key="NSFrame">{{0, 450}, {320, 83}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1041366711"/>
<string key="NSReuseIdentifierKey">_NS:10</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
<bytes key="NSWhite">MC42NjY2NjY2NjY3IDAuNwA</bytes>
</object>
<float key="IBUIAlpha">0.69999998807907104</float>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUIToolbar" id="831191623">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">290</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUISlider" id="334977839">
<reference key="NSNextResponder" ref="831191623"/>
<int key="NSvFlags">290</int>
<string key="NSFrame">{{66, 11}, {180, 23}}</string>
<reference key="NSSuperview" ref="831191623"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="644225698"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<string key="NSHuggingPriority">{250, 250}</string>
<bool key="IBUIOpaque">NO</bool>
<object class="IBUIAccessibilityConfiguration" key="IBUIAccessibilityConfiguration">
<integer value="512" key="IBUIAccessibilityTraits"/>
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIContentHorizontalAlignment">0</int>
<int key="IBUIContentVerticalAlignment">0</int>
<float key="IBUIValue">0.5</float>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 44}}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="334977839"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIBarStyle">2</int>
<array class="NSMutableArray" key="IBUIItems">
<object class="IBUIBarButtonItem" id="717140598">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<int key="IBUIStyle">1</int>
<reference key="IBUIToolbar" ref="831191623"/>
<int key="IBUISystemItemIdentifier">0</int>
</object>
<object class="IBUIBarButtonItem" id="283005401">
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUICustomView" ref="334977839"/>
<reference key="IBUIToolbar" ref="831191623"/>
</object>
<object class="IBUIBarButtonItem" id="776984111">
<string key="IBUITitle">--:--</string>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<reference key="IBUIToolbar" ref="831191623"/>
</object>
</array>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 548}}</string>
<string key="NSFrameSize">{320, 568}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="831191623"/>
<reference key="NSNextKeyView" ref="991208409"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
......@@ -274,9 +274,6 @@
<int key="NSID">2</int>
</object>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
<int key="IBUIStatusBarStyle">1</int>
</object>
<object class="IBUIScreenMetrics" key="IBUISimulatedDestinationMetrics">
<string key="IBUISimulatedSizeMetricsClass">IBUIScreenMetrics</string>
<object class="NSMutableDictionary" key="IBUINormalizedOrientationToSizeMap">
......@@ -296,46 +293,9 @@
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUILabel" id="1062665686">
<nil key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{42, 21}</string>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClipsSubviews">YES</bool>
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Label</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MCAwIDAAA</bytes>
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
</object>
<nil key="IBUIHighlightedColor"/>
<int key="IBUIBaselineAdjustment">0</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<double key="pointSize">17</double>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">17</double>
<int key="NSfFlags">16</int>
</object>
<bool key="IBUIAdjustsFontSizeToFit">NO</bool>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">3</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">movieView</string>
......@@ -344,14 +304,6 @@
</object>
<int key="connectionID">93</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">tapBarView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="831191623"/>
</object>
<int key="connectionID">94</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">positionSlider</string>
......@@ -376,6 +328,22 @@
</object>
<int key="connectionID">97</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="191373211"/>
</object>
<int key="connectionID">105</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">controllerPanel</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="644225698"/>
</object>
<int key="connectionID">104</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">audioSwitcherButton</string>
......@@ -392,6 +360,14 @@
</object>
<int key="connectionID">100</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">subtitleSwitcherButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="649952457"/>
</object>
<int key="connectionID">103</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">playPauseButton</string>
......@@ -410,19 +386,11 @@
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">subtitleSwitcherButton</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="649952457"/>
</object>
<int key="connectionID">103</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">controllerPanel</string>
<string key="label">toolbar</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="644225698"/>
<reference key="destination" ref="831191623"/>
</object>
<int key="connectionID">104</int>
<int key="connectionID">106</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
......@@ -516,11 +484,6 @@
<reference key="object" ref="975951072"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">12</int>
<reference key="object" ref="1062665686"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">84</int>
<reference key="object" ref="831191623"/>
......@@ -557,7 +520,9 @@
<object class="IBObjectRecord">
<int key="objectID">91</int>
<reference key="object" ref="991208409"/>
<array class="NSMutableArray" key="children"/>
<reference key="parent" ref="191373211"/>
<string key="objectName">Movie view</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">92</int>
......@@ -570,15 +535,16 @@
<reference ref="133336185"/>
</array>
<reference key="parent" ref="191373211"/>
<string key="objectName">Controls panel</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">75</int>
<reference key="object" ref="133336185"/>
<int key="objectID">74</int>
<reference key="object" ref="649952457"/>
<reference key="parent" ref="644225698"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">77</int>
<reference key="object" ref="722825395"/>
<int key="objectID">78</int>
<reference key="object" ref="1041366711"/>
<reference key="parent" ref="644225698"/>
</object>
<object class="IBObjectRecord">
......@@ -587,13 +553,13 @@
<reference key="parent" ref="644225698"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">78</int>
<reference key="object" ref="1041366711"/>
<int key="objectID">77</int>
<reference key="object" ref="722825395"/>
<reference key="parent" ref="644225698"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">74</int>
<reference key="object" ref="649952457"/>
<int key="objectID">75</int>
<reference key="object" ref="133336185"/>
<reference key="parent" ref="644225698"/>
</object>
</array>
......@@ -604,7 +570,6 @@
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="74.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="75.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="76.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
......@@ -623,7 +588,7 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">104</int>
<int key="maxID">107</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -687,8 +652,8 @@
<string key="playPauseButton">UIButton</string>
<string key="positionSlider">UISlider</string>
<string key="subtitleSwitcherButton">UIButton</string>
<string key="tapBarView">UIView</string>
<string key="timeDisplay">UIBarButtonItem</string>
<string key="toolbar">UIToolbar</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
<object class="IBToOneOutletInfo" key="audioSwitcherButton">
......@@ -727,14 +692,14 @@
<string key="name">subtitleSwitcherButton</string>
<string key="candidateClassName">UIButton</string>
</object>
<object class="IBToOneOutletInfo" key="tapBarView">
<string key="name">tapBarView</string>
<string key="candidateClassName">UIView</string>
</object>
<object class="IBToOneOutletInfo" key="timeDisplay">
<string key="name">timeDisplay</string>
<string key="candidateClassName">UIBarButtonItem</string>
</object>
<object class="IBToOneOutletInfo" key="toolbar">
<string key="name">toolbar</string>
<string key="candidateClassName">UIToolbar</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
......
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