Skip to content

Commit

Permalink
Update PYPhotosView
Browse files Browse the repository at this point in the history
Update PYPhotosView
  • Loading branch information
ko1o committed Jul 28, 2016
1 parent befd9f9 commit 4698a65
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 21 deletions.
1 change: 0 additions & 1 deletion PYPhotosView/Controller/PYMoviePlayerController.m
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ - (void)setMovieURL:(NSURL *)contentURL
if ([fileManager fileExistsAtPath:self.movieCachePath]) { // 已缓存
// 本地已经有缓存直接播放
contentURL = [NSURL fileURLWithPath:self.movieCachePath];
NSLog(@"%@", self.movieCachePath);
_downloadManger = nil;
} else if (!self.movie.skip){ // 未缓存
if (_downloadManger) return; // 已经开始下载
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
6BA2830C1D004FB3007FE7E8 /* PYPhotoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BA282EC1D004FB3007FE7E8 /* PYPhotoView.m */; };
6BC54BDA1D20314500580646 /* MBProgressHUD.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 6BC54BD71D20314500580646 /* MBProgressHUD.bundle */; };
6BC54BDB1D20314500580646 /* MBProgressHUD.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BC54BD91D20314500580646 /* MBProgressHUD.m */; };
6BD8141C1D499E690012C7ED /* PYDownloadDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BD8141B1D499E690012C7ED /* PYDownloadDataManager.m */; };
6BD814201D49F20C0012C7ED /* PYDownloadDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BD8141F1D49F20C0012C7ED /* PYDownloadDataManager.m */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -229,8 +229,8 @@
6BC54BD71D20314500580646 /* MBProgressHUD.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = MBProgressHUD.bundle; sourceTree = "<group>"; };
6BC54BD81D20314500580646 /* MBProgressHUD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MBProgressHUD.h; sourceTree = "<group>"; };
6BC54BD91D20314500580646 /* MBProgressHUD.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MBProgressHUD.m; sourceTree = "<group>"; };
6BD8141A1D499E690012C7ED /* PYDownloadDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PYDownloadDataManager.h; path = ../../PYPhotosViewExample/PYPhotosViewExample/Lib/PYDownloadDataManager.h; sourceTree = "<group>"; };
6BD8141B1D499E690012C7ED /* PYDownloadDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PYDownloadDataManager.m; path = ../../PYPhotosViewExample/PYPhotosViewExample/Lib/PYDownloadDataManager.m; sourceTree = "<group>"; };
6BD8141E1D49F20C0012C7ED /* PYDownloadDataManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PYDownloadDataManager.h; sourceTree = "<group>"; };
6BD8141F1D49F20C0012C7ED /* PYDownloadDataManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PYDownloadDataManager.m; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -540,8 +540,8 @@
6BD8141D1D49E37A0012C7ED /* Tool */ = {
isa = PBXGroup;
children = (
6BD8141A1D499E690012C7ED /* PYDownloadDataManager.h */,
6BD8141B1D499E690012C7ED /* PYDownloadDataManager.m */,
6BD8141E1D49F20C0012C7ED /* PYDownloadDataManager.h */,
6BD8141F1D49F20C0012C7ED /* PYDownloadDataManager.m */,
);
path = Tool;
sourceTree = "<group>";
Expand Down Expand Up @@ -713,7 +713,6 @@
6BA1B29A1D2A24530010343C /* HTTPAuthenticationRequest.m in Sources */,
6B4904B11D05DA1F00A0A88C /* PYDALabeledCircularProgressView.m in Sources */,
6BA283091D004FB3007FE7E8 /* PYConst.m in Sources */,
6BD8141C1D499E690012C7ED /* PYDownloadDataManager.m in Sources */,
6B7B2C371D1CD8610012B152 /* PYPublishExampleViewController.m in Sources */,
6BA282F21D004FB3007FE7E8 /* PYPhotosViewController.m in Sources */,
6B7B2BF71D1C092A0012B152 /* UIImageView+HighlightedWebCache.m in Sources */,
Expand All @@ -724,6 +723,7 @@
6BA1B2CF1D34B0D30010343C /* PYMovie.m in Sources */,
6BA1B28E1D2A24530010343C /* ContextFilterLogFormatter.m in Sources */,
6B4904B01D05DA1F00A0A88C /* PYDACircularProgressView.m in Sources */,
6BD814201D49F20C0012C7ED /* PYDownloadDataManager.m in Sources */,
6BA1B1621D278D2F0010343C /* PYMoviePlayerController.m in Sources */,
6B7B2C3A1D1D22DA0012B152 /* PYNavigationController.m in Sources */,
6BA1B2A21D2A24530010343C /* HTTPServer.m in Sources */,
Expand Down
Binary file not shown.
17 changes: 3 additions & 14 deletions PYPhotosViewExample/PYPhotosViewExample/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ @implementation AppDelegate
- (void)startServer
{
// Start the server (and check for problems)

NSError *error;
if([httpServer start:&error])
{
Expand All @@ -33,20 +32,13 @@ - (void)startServer

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

// Configure our logging framework.
// To keep things simple and fast, we're just going to log to the Xcode console.
[DDLog addLogger:[DDTTYLogger sharedInstance]];

// Create server using our custom MyHTTPServer class
// 创建本地服务器
httpServer = [[HTTPServer alloc] init];

// Tell the server to broadcast its presence via Bonjour.
// This allows browsers such as Safari to automatically discover our service.
// 设置通讯类型为tcp
[httpServer setType:@"_http._tcp."];

// Normally there's no need to run our server on any specific port.
// Technologies like Bonjour allow clients to dynamically discover the server's port at runtime.
// However, for easy testing you may want force a certain port so you can just hit the refresh button.
// 设置端口
[httpServer setPort:12345];

// Serve files from our embedded Web folder
Expand All @@ -73,14 +65,11 @@ - (void)applicationWillResignActive:(UIApplication *)application
- (void)applicationDidEnterBackground:(UIApplication *)application
{
[httpServer stop];
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
[self startServer];
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
Expand Down

0 comments on commit 4698a65

Please sign in to comment.