Commit 087239b8 authored by Felix Paul Kühne's avatar Felix Paul Kühne

AspenProject: implement basic file playback (iPhone only)

parent 4c3222f5
......@@ -9,9 +9,13 @@
#import <UIKit/UIKit.h>
@interface VLCMovieViewController : UIViewController <UISplitViewControllerDelegate>
{
VLCMediaPlayer *_mediaPlayer;
UIView *_movieView;
}
@property (strong, nonatomic) MLFile *mediaItem;
@property (nonatomic, retain) IBOutlet UIView * movieView;
@property (strong, nonatomic) IBOutlet UILabel *detailDescriptionLabel;
@property (strong, nonatomic) MLFile *mediaItem;
@end
......@@ -10,15 +10,14 @@
@interface VLCMovieViewController ()
@property (strong, nonatomic) UIPopoverController *masterPopoverController;
- (void)configureView;
@end
@implementation VLCMovieViewController
@synthesize movieView=_movieView;
- (void)dealloc
{
[_mediaItem release];
[_detailDescriptionLabel release];
[_masterPopoverController release];
[super dealloc];
}
......@@ -30,9 +29,6 @@
if (_mediaItem != newMediaItem) {
[_mediaItem release];
_mediaItem = [newMediaItem retain];
// Update the view.
[self configureView];
}
if (self.masterPopoverController != nil) {
......@@ -40,21 +36,37 @@
}
}
- (void)configureView
- (void)viewDidLoad
{
// Update the user interface for the media item.
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[super viewDidLoad];
_mediaPlayer = [[VLCMediaPlayer alloc] init];
[_mediaPlayer setDelegate:self];
[_mediaPlayer setDrawable:self.movieView];
}
- (void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
if (self.mediaItem) {
self.detailDescriptionLabel.text = [self.mediaItem title];
self.title = [self.mediaItem title];
[_mediaPlayer setMedia:[VLCMedia mediaWithURL:[NSURL URLWithString:self.mediaItem.url]]];
if (self.mediaItem.lastPosition && [self.mediaItem.lastPosition floatValue] < 0.99)
[_mediaPlayer setPosition:[self.mediaItem.lastPosition floatValue]];
[_mediaPlayer play];
[UIApplication sharedApplication].idleTimerDisabled = YES;
}
}
- (void)viewDidLoad
- (void)viewWillDisappear:(BOOL)animated
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
[self configureView];
[_mediaPlayer pause];
[UIApplication sharedApplication].idleTimerDisabled = NO;
[super viewWillDisappear:animated];
}
- (void)didReceiveMemoryWarning
......
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1536</int>
<string key="IBDocument.SystemVersion">12A269</string>
<string key="IBDocument.InterfaceBuilderVersion">2835</string>
<string key="IBDocument.AppKitVersion">1187</string>
<string key="IBDocument.HIToolboxVersion">624.00</string>
<int key="IBDocument.SystemTarget">1552</int>
<string key="IBDocument.SystemVersion">12D78</string>
<string key="IBDocument.InterfaceBuilderVersion">3084</string>
<string key="IBDocument.AppKitVersion">1187.37</string>
<string key="IBDocument.HIToolboxVersion">626.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="NS.object.0">1919</string>
<string key="NS.object.0">2083</string>
</object>
<array key="IBDocument.IntegratedClassDependencies">
<string>IBNSLayoutConstraint</string>
......@@ -36,51 +36,32 @@
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUILabel" id="741552823">
<object class="IBUIView" id="399609873">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">298</int>
<string key="NSFrame">{{20, 265}, {280, 18}}</string>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{320, 550}</string>
<reference key="NSSuperview" ref="191373211"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace" id="459847899">
<int key="NSID">2</int>
</object>
</object>
<bool key="IBUIClipsSubviews">YES</bool>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">Detail view content goes here</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">1</int>
<float key="IBUIMinimumFontSize">10</float>
<int key="IBUITextAlignment">1</int>
<object class="IBUIFontDescription" key="IBUIFontDescription">
<int key="type">1</int>
<int key="size">4</int>
</object>
<object class="NSFont" key="IBUIFont">
<string key="NSName">Helvetica</string>
<double key="NSSize">14</double>
<int key="NSfFlags">16</int>
</object>
</object>
</array>
<string key="NSFrame">{{0, 20}, {320, 548}}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="741552823"/>
<reference key="NSNextKeyView" ref="399609873"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
<object class="NSColorSpace" key="NSCustomColorSpace">
<int key="NSID">2</int>
</object>
<reference key="NSCustomColorSpace" ref="459847899"/>
</object>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
<object class="IBUIScreenMetrics" key="IBUISimulatedDestinationMetrics">
......@@ -102,6 +83,36 @@
</object>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
</object>
<object class="IBUILabel" id="216270133">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{42, 21}</string>
<reference key="NSSuperview"/>
<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">
......@@ -115,11 +126,11 @@
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">detailDescriptionLabel</string>
<string key="label">movieView</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="741552823"/>
<reference key="destination" ref="399609873"/>
</object>
<int key="connectionID">6</int>
<int key="connectionID">22</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
......@@ -134,31 +145,31 @@
<int key="objectID">1</int>
<reference key="object" ref="191373211"/>
<array class="NSMutableArray" key="children">
<object class="IBNSLayoutConstraint" id="809097062">
<reference key="firstItem" ref="741552823"/>
<int key="firstAttribute">10</int>
<object class="IBNSLayoutConstraint" id="675200279">
<reference key="firstItem" ref="191373211"/>
<int key="firstAttribute">4</int>
<int key="relation">0</int>
<reference key="secondItem" ref="191373211"/>
<int key="secondAttribute">10</int>
<reference key="secondItem" ref="399609873"/>
<int key="secondAttribute">4</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
<double key="value">-2</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="191373211"/>
<int key="scoringType">5</int>
<float key="scoringTypeFloat">22</float>
<int key="contentType">2</int>
<int key="scoringType">3</int>
<float key="scoringTypeFloat">9</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="202577948">
<reference key="firstItem" ref="191373211"/>
<object class="IBNSLayoutConstraint" id="705227457">
<reference key="firstItem" ref="399609873"/>
<int key="firstAttribute">6</int>
<int key="relation">0</int>
<reference key="secondItem" ref="741552823"/>
<reference key="secondItem" ref="191373211"/>
<int key="secondAttribute">6</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="191373211"/>
......@@ -166,15 +177,31 @@
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="396311018">
<reference key="firstItem" ref="741552823"/>
<object class="IBNSLayoutConstraint" id="32588610">
<reference key="firstItem" ref="399609873"/>
<int key="firstAttribute">3</int>
<int key="relation">0</int>
<reference key="secondItem" ref="191373211"/>
<int key="secondAttribute">3</int>
<float key="multiplier">1</float>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="191373211"/>
<int key="scoringType">8</int>
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<object class="IBNSLayoutConstraint" id="902026423">
<reference key="firstItem" ref="399609873"/>
<int key="firstAttribute">5</int>
<int key="relation">0</int>
<reference key="secondItem" ref="191373211"/>
<int key="secondAttribute">5</int>
<float key="multiplier">1</float>
<object class="IBNSLayoutSymbolicConstant" key="constant">
<double key="value">20</double>
<object class="IBLayoutConstant" key="constant">
<double key="value">0.0</double>
</object>
<float key="priority">1000</float>
<reference key="containingView" ref="191373211"/>
......@@ -182,7 +209,7 @@
<float key="scoringTypeFloat">29</float>
<int key="contentType">3</int>
</object>
<reference ref="741552823"/>
<reference ref="399609873"/>
</array>
<reference key="parent" ref="0"/>
</object>
......@@ -198,56 +225,99 @@
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4</int>
<reference key="object" ref="741552823"/>
<int key="objectID">12</int>
<reference key="object" ref="216270133"/>
<reference key="parent" ref="0"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">13</int>
<reference key="object" ref="399609873"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">7</int>
<reference key="object" ref="396311018"/>
<int key="objectID">24</int>
<reference key="object" ref="902026423"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">9</int>
<reference key="object" ref="202577948"/>
<int key="objectID">26</int>
<reference key="object" ref="32588610"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">11</int>
<reference key="object" ref="809097062"/>
<int key="objectID">27</int>
<reference key="object" ref="705227457"/>
<reference key="parent" ref="191373211"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">31</int>
<reference key="object" ref="675200279"/>
<reference key="parent" ref="191373211"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
<string key="-1.CustomClassName">VLCDetailViewController</string>
<string key="-1.CustomClassName">VLCMovieViewController</string>
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="-2.CustomClassName">UIResponder</string>
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<array class="NSMutableArray" key="1.IBViewMetadataConstraints">
<reference ref="396311018"/>
<reference ref="202577948"/>
<reference ref="809097062"/>
<reference ref="902026423"/>
<reference ref="32588610"/>
<reference ref="705227457"/>
<reference ref="675200279"/>
</array>
<string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<boolean value="NO" key="4.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="7.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="12.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<boolean value="NO" key="13.IBViewMetadataTranslatesAutoresizingMaskIntoConstraints"/>
<string key="24.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="26.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="27.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string key="31.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">11</int>
<int key="maxID">31</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">NSLayoutConstraint</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSLayoutConstraint.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCMovieViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">movieView</string>
<string key="NS.object.0">UIView</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">movieView</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">movieView</string>
<string key="candidateClassName">UIView</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/VLCMovieViewController.h</string>
</object>
</object>
</array>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<bool key="IBDocument.UseAutolayout">YES</bool>
<string key="IBCocoaTouchPluginVersion">1919</string>
<string key="IBCocoaTouchPluginVersion">2083</string>
</data>
</archive>
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