Skip to content

Commit

Permalink
cleanup the movieplayer view
Browse files Browse the repository at this point in the history
  • Loading branch information
orta committed May 20, 2013
1 parent 040f390 commit 6a663f0
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions GamesScreensaver/GamesScreensaverView.m
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ - (void)getNextVideo {
[DownloadRequest setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
[self removeProgressIndicator];
[self removeThumbnailImage];

[[NSUserDefaults userDefaults] removeObjectForKey:StreamValueProgressDefault];
[[NSUserDefaults userDefaults] synchronize];

[self createMovieViewForFilePathorURL:_currentVideoPath];

} failure:^(AFHTTPRequestOperation *operation, NSError *error) {
Expand All @@ -158,6 +162,7 @@ - (void)getNextVideo {
}
}];

[self removeMovieView];
[self addProgressIndicatorToView];
[self addMovieLabel];
[DownloadRequest start];
Expand Down Expand Up @@ -256,11 +261,15 @@ - (void)playURLAtAddress:(NSURL *)url {
}];
}

- (void)createMovieViewForFilePathorURL:(id)fileOrURL {
- (void)removeMovieView {
[_streamingMovieView.player pause];
[_streamingMovieView removeFromSuperview];
_streamingMovieView = nil;

}

- (void)createMovieViewForFilePathorURL:(id)fileOrURL {
[self removeMovieView];

_streamingMovieView = [[RMVideoView alloc] initWithFrame:CGRectInset(self.bounds, 20, 20)];
_streamingMovieView.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable;
_streamingMovieView.autoresizesSubviews = YES;
Expand Down

0 comments on commit 6a663f0

Please sign in to comment.