Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for playing bundled files #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Pod/Classes/AUMediaItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ typedef NS_ENUM(NSInteger, AUMediaType){

@protocol AUMediaItem <NSObject, NSCoding>

@optional

- (bool)isLocalItem;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BOOL

- (NSString *)localPath;

@required

/*****************************************************************************
Expand Down
6 changes: 5 additions & 1 deletion Pod/Classes/AUMediaPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,11 @@ - (void)updatePlayerWithItem:(id<AUMediaItem>)item error:(NSError * __autoreleas
[self prepareForCurrentItemReplacementWithItem:item];

NSURL *url = nil;
if ([_library itemIsDownloaded:item]) {
if([item isLocalItem]) {
url = [NSURL fileURLWithPath: [item localPath]];
NSLog(@"Playback will occur with a completely local item at: %@", url);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this log necessary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, ofc not but it followed from the other statements in that sequence which logs in a similar way?

}
if ([_library itemIsDownloaded:item] && !url) {
url = [NSURL fileURLWithPath:[_library localPathForItem:item]];
NSLog(@"Playback will occur from local file with url: %@", url);
}
Expand Down