Permalink
Browse files

第二次提交

  • Loading branch information...
1 parent 098f1bc commit d3e0d8d3fa3f9ed49bb549745dff313e784ae8f6 zjzhang committed Sep 26, 2011
@@ -16,30 +16,33 @@
448BF8091430D433003C057D /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 448BF8071430D433003C057D /* MainWindow.xib */; };
448BF80C1430D433003C057D /* MoviePlayerViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 448BF80B1430D433003C057D /* MoviePlayerViewController.m */; };
448BF80F1430D433003C057D /* MoviePlayerViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 448BF80D1430D433003C057D /* MoviePlayerViewController.xib */; };
+ 448BF81A1430D46A003C057D /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 448BF8191430D46A003C057D /* MediaPlayer.framework */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
448BF7F11430D433003C057D /* MoviePlayer.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MoviePlayer.app; sourceTree = BUILT_PRODUCTS_DIR; };
448BF7F51430D433003C057D /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
448BF7F71430D433003C057D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
448BF7F91430D433003C057D /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
- 448BF7FD1430D433003C057D /* MoviePlayer-Info.plist */ = {isa = PBXFileReference; path = "MoviePlayer-Info.plist"; sourceTree = "<group>"; };
+ 448BF7FD1430D433003C057D /* MoviePlayer-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "MoviePlayer-Info.plist"; sourceTree = "<group>"; };
448BF7FF1430D433003C057D /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
448BF8011430D433003C057D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
- 448BF8031430D433003C057D /* MoviePlayer-Prefix.pch */ = {isa = PBXFileReference; path = "MoviePlayer-Prefix.pch"; sourceTree = "<group>"; };
- 448BF8041430D433003C057D /* MoviePlayerAppDelegate.h */ = {isa = PBXFileReference; path = MoviePlayerAppDelegate.h; sourceTree = "<group>"; };
+ 448BF8031430D433003C057D /* MoviePlayer-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "MoviePlayer-Prefix.pch"; sourceTree = "<group>"; };
+ 448BF8041430D433003C057D /* MoviePlayerAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoviePlayerAppDelegate.h; sourceTree = "<group>"; };
448BF8051430D433003C057D /* MoviePlayerAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MoviePlayerAppDelegate.m; sourceTree = "<group>"; };
448BF8081430D433003C057D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = "<group>"; };
- 448BF80A1430D433003C057D /* MoviePlayerViewController.h */ = {isa = PBXFileReference; path = MoviePlayerViewController.h; sourceTree = "<group>"; };
+ 448BF80A1430D433003C057D /* MoviePlayerViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MoviePlayerViewController.h; sourceTree = "<group>"; };
448BF80B1430D433003C057D /* MoviePlayerViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MoviePlayerViewController.m; sourceTree = "<group>"; };
448BF80E1430D433003C057D /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MoviePlayerViewController.xib; sourceTree = "<group>"; };
+ 448BF8191430D46A003C057D /* MediaPlayer.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MediaPlayer.framework; path = System/Library/Frameworks/MediaPlayer.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
448BF7EE1430D433003C057D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 448BF81A1430D46A003C057D /* MediaPlayer.framework in Frameworks */,
448BF7F61430D433003C057D /* UIKit.framework in Frameworks */,
448BF7F81430D433003C057D /* Foundation.framework in Frameworks */,
448BF7FA1430D433003C057D /* CoreGraphics.framework in Frameworks */,
@@ -52,6 +55,7 @@
448BF7E61430D433003C057D = {
isa = PBXGroup;
children = (
+ 448BF8191430D46A003C057D /* MediaPlayer.framework */,
448BF7FB1430D433003C057D /* MoviePlayer */,
448BF7F41430D433003C057D /* Frameworks */,
448BF7F21430D433003C057D /* Products */,
@@ -7,7 +7,14 @@
//
#import <UIKit/UIKit.h>
+#import <MediaPlayer/MediaPlayer.h>
+@interface MoviePlayerViewController : UIViewController {
+ UIView *viewSub;
+ MPMoviePlayerViewController *playerViewController ;
+}
-@interface MoviePlayerViewController : UIViewController
+@property (nonatomic, retain) IBOutlet UIView *viewSub;
+@property (nonatomic, retain) IBOutlet MPMoviePlayerViewController *playerViewController;
+- (IBAction)btnMoviePlayer:(id)sender;
@end
@@ -7,9 +7,12 @@
//
#import "MoviePlayerViewController.h"
+#import <MobileCoreServices/UTCoreTypes.h>
+#import <MediaPlayer/MediaPlayer.h>
@implementation MoviePlayerViewController
-
+@synthesize viewSub;
+@synthesize playerViewController;
- (void)didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
@@ -20,16 +23,33 @@ - (void)didReceiveMemoryWarning
#pragma mark - View lifecycle
-/*
+
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad
{
+
[super viewDidLoad];
+
+}
+
+
+- (void) movieFinishedCallback:(NSNotification*) aNotification {
+ MPMoviePlayerController *player = [aNotification object];
+ [[NSNotificationCenter defaultCenter]
+ removeObserver:self
+ name:MPMoviePlayerPlaybackDidFinishNotification
+ object:player];
+ [player stop];
+ [self.playerViewController.view removeFromSuperview];
+ self.playerViewController=nil;
+ //[self.playerViewController release];
+ [self.viewSub setNeedsLayout];
+ [player autorelease];
}
-*/
- (void)viewDidUnload
{
+ [self setViewSub:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
@@ -41,4 +61,29 @@ - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interface
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
+- (IBAction)btnMoviePlayer:(id)sender {
+ NSURL *URL = [[NSURL alloc] initWithString:@"http://221.7.245.196/up/file/recordTest1.mov"];
+ self.playerViewController =
+ [[MPMoviePlayerViewController alloc]
+ initWithContentURL:URL];
+ self.playerViewController.moviePlayer.movieSourceType = MPMovieSourceTypeFile;
+ [[NSNotificationCenter defaultCenter]
+ addObserver:self
+ selector:@selector(movieFinishedCallback:)
+ name:MPMoviePlayerPlaybackDidFinishNotification
+ object:[playerViewController moviePlayer]];
+
+ [[self.playerViewController view] setFrame: [self.viewSub bounds]]; // frame must match parent view
+ [self.viewSub addSubview:self.playerViewController.view];
+
+ //---play movie---
+ //MPMoviePlayerController *player =[self.playerViewController moviePlayer];
+ //[player play];
+ [playerViewController.moviePlayer play];
+ [URL release];
+}
+- (void)dealloc {
+ [viewSub release];
+ [super dealloc];
+}
@end
@@ -1,18 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">800</int>
- <string key="IBDocument.SystemVersion">10C540</string>
- <string key="IBDocument.InterfaceBuilderVersion">759</string>
- <string key="IBDocument.AppKitVersion">1038.25</string>
- <string key="IBDocument.HIToolboxVersion">458.00</string>
+ <int key="IBDocument.SystemTarget">1056</int>
+ <string key="IBDocument.SystemVersion">11B26</string>
+ <string key="IBDocument.InterfaceBuilderVersion">1617</string>
+ <string key="IBDocument.AppKitVersion">1138</string>
+ <string key="IBDocument.HIToolboxVersion">566.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">77</string>
+ <string key="NS.object.0">534</string>
</object>
- <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
+ <object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="6"/>
+ <string>IBProxyObject</string>
+ <string>IBUIView</string>
+ <string>IBUIButton</string>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -23,9 +25,7 @@
<object class="NSArray" key="dict.sortedKeys" id="0">
<bool key="EncodedWithXMLCoder">YES</bool>
</object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.values" ref="0"/>
</object>
<object class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -40,14 +40,63 @@
<object class="IBUIView" id="774585933">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
- <string key="NSFrameSize">{320, 460}</string>
+ <object class="NSMutableArray" key="NSSubviews">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="IBUIView" id="704117808">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">274</int>
+ <string key="NSFrameSize">{320, 341}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:180</string>
+ <object class="NSColor" key="IBUIBackgroundColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ <object class="NSColorSpace" key="NSCustomColorSpace" id="756192404">
+ <int key="NSID">2</int>
+ </object>
+ </object>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ </object>
+ <object class="IBUIButton" id="517467760">
+ <reference key="NSNextResponder" ref="774585933"/>
+ <int key="NSvFlags">292</int>
+ <string key="NSFrame">{{20, 403}, {72, 37}}</string>
+ <reference key="NSSuperview" ref="774585933"/>
+ <reference key="NSWindow"/>
+ <string key="NSReuseIdentifierKey">_NS:222</string>
+ <bool key="IBUIOpaque">NO</bool>
+ <string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
+ <int key="IBUIContentHorizontalAlignment">0</int>
+ <int key="IBUIContentVerticalAlignment">0</int>
+ <object class="NSFont" key="IBUIFont">
+ <string key="NSName">Helvetica-Bold</string>
+ <double key="NSSize">15</double>
+ <int key="NSfFlags">16</int>
+ </object>
+ <int key="IBUIButtonType">1</int>
+ <object class="NSColor" key="IBUIHighlightedTitleColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MQA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleColor">
+ <int key="NSColorSpace">1</int>
+ <bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
+ </object>
+ <object class="NSColor" key="IBUINormalTitleShadowColor">
+ <int key="NSColorSpace">3</int>
+ <bytes key="NSWhite">MC41AA</bytes>
+ </object>
+ </object>
+ </object>
+ <string key="NSFrame">{{0, 20}, {320, 460}}</string>
<reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
+ <reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC43NQA</bytes>
- <object class="NSColorSpace" key="NSCustomColorSpace">
- <int key="NSID">2</int>
- </object>
+ <reference key="NSCustomColorSpace" ref="756192404"/>
</object>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
@@ -65,6 +114,23 @@
</object>
<int key="connectionID">7</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchEventConnection" key="connection">
+ <string key="label">btnMoviePlayer:</string>
+ <reference key="source" ref="517467760"/>
+ <reference key="destination" ref="372490531"/>
+ <int key="IBEventType">7</int>
+ </object>
+ <int key="connectionID">10</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBCocoaTouchOutletConnection" key="connection">
+ <string key="label">viewSub</string>
+ <reference key="source" ref="372490531"/>
+ <reference key="destination" ref="704117808"/>
+ </object>
+ <int key="connectionID">11</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -89,54 +155,93 @@
<object class="IBObjectRecord">
<int key="objectID">6</int>
<reference key="object" ref="774585933"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="704117808"/>
+ <reference ref="517467760"/>
+ </object>
<reference key="parent" ref="0"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">8</int>
+ <reference key="object" ref="704117808"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">9</int>
+ <reference key="object" ref="517467760"/>
+ <reference key="parent" ref="774585933"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
+ <string>-1.IBPluginDependency</string>
<string>-2.CustomClassName</string>
- <string>6.IBEditorWindowLastContentRect</string>
+ <string>-2.IBPluginDependency</string>
<string>6.IBPluginDependency</string>
+ <string>8.IBPluginDependency</string>
+ <string>9.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>MoviePlayerViewController</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>UIResponder</string>
- <string>{{239, 654}, {320, 480}}</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
+ <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
<object class="NSMutableDictionary" key="unlocalizedProperties">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.values" ref="0"/>
</object>
<nil key="activeLocalization"/>
<object class="NSMutableDictionary" key="localizations">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference key="dict.sortedKeys" ref="0"/>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- </object>
+ <reference key="dict.values" ref="0"/>
</object>
<nil key="sourceID"/>
- <int key="maxID">7</int>
+ <int key="maxID">11</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">MoviePlayerViewController</string>
<string key="superclassName">UIViewController</string>
+ <object class="NSMutableDictionary" key="actions">
+ <string key="NS.key.0">btnMoviePlayer:</string>
+ <string key="NS.object.0">id</string>
+ </object>
+ <object class="NSMutableDictionary" key="actionInfosByName">
+ <string key="NS.key.0">btnMoviePlayer:</string>
+ <object class="IBActionInfo" key="NS.object.0">
+ <string key="name">btnMoviePlayer:</string>
+ <string key="candidateClassName">id</string>
+ </object>
+ </object>
+ <object class="NSMutableDictionary" key="outlets">
+ <string key="NS.key.0">viewSub</string>
+ <string key="NS.object.0">UIView</string>
+ </object>
+ <object class="NSMutableDictionary" key="toOneOutletInfosByName">
+ <string key="NS.key.0">viewSub</string>
+ <object class="IBToOneOutletInfo" key="NS.object.0">
+ <string key="name">viewSub</string>
+ <string key="candidateClassName">UIView</string>
+ </object>
+ </object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">MoviePlayerViewController.h</string>
+ <string key="minorKey">./Classes/MoviePlayerViewController.h</string>
</object>
</object>
</object>
@@ -148,9 +253,7 @@
<integer value="3100" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
- <string key="IBDocument.LastKnownRelativeProjectPath">MoviePlayer.xcodeproj</string>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">77</string>
- <nil key="IBCocoaTouchSimulationTargetRuntimeIdentifier"/>
+ <string key="IBCocoaTouchPluginVersion">534</string>
</data>
</archive>

0 comments on commit d3e0d8d

Please sign in to comment.