-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
added error reporting callback to ASVideoNode #260
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,14 +21,14 @@ | |
@protocol ASVideoNodeDelegate; | ||
|
||
typedef NS_ENUM(NSInteger, ASVideoNodePlayerState) { | ||
ASVideoNodePlayerStateUnknown, | ||
ASVideoNodePlayerStateInitialLoading, | ||
ASVideoNodePlayerStateReadyToPlay, | ||
ASVideoNodePlayerStatePlaybackLikelyToKeepUpButNotPlaying, | ||
ASVideoNodePlayerStatePlaying, | ||
ASVideoNodePlayerStateLoading, | ||
ASVideoNodePlayerStatePaused, | ||
ASVideoNodePlayerStateFinished | ||
ASVideoNodePlayerStateUnknown, | ||
ASVideoNodePlayerStateInitialLoading, | ||
ASVideoNodePlayerStateReadyToPlay, | ||
ASVideoNodePlayerStatePlaybackLikelyToKeepUpButNotPlaying, | ||
ASVideoNodePlayerStatePlaying, | ||
ASVideoNodePlayerStateLoading, | ||
ASVideoNodePlayerStatePaused, | ||
ASVideoNodePlayerStateFinished | ||
}; | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
@@ -110,7 +110,7 @@ NS_ASSUME_NONNULL_BEGIN | |
* @param videoNode The video node. | ||
* @param state player state that is going to be set. | ||
* @discussion Delegate method invoked when player changes it's state to | ||
* ASVideoNodePlayerStatePlaying or ASVideoNodePlayerStatePaused | ||
* ASVideoNodePlayerStatePlaying or ASVideoNodePlayerStatePaused | ||
* and asks delegate if state change is valid | ||
*/ | ||
- (BOOL)videoNode:(ASVideoNode*)videoNode shouldChangePlayerStateTo:(ASVideoNodePlayerState)state; | ||
|
@@ -147,6 +147,13 @@ NS_ASSUME_NONNULL_BEGIN | |
* @param videoNode The videoNode | ||
*/ | ||
- (void)videoNodeDidRecoverFromStall:(ASVideoNode *)videoNode; | ||
/** | ||
* @abstract Delegate method invoked when an error occurs while trying to play a video | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about "while trying to load an asset". |
||
* @param videoNode The videoNode. | ||
* @param currentItem The error that occurs | ||
*/ | ||
- (void)videoNodeDidFailToInitAssetFor:(ASVideoNode *)videoNode withError:(NSError *)error; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To follow convention, let's make it |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a newline already. Please remove this one. |
||
|
||
@end | ||
|
||
|
@@ -157,3 +164,4 @@ NS_ASSUME_NONNULL_BEGIN | |
@end | ||
|
||
NS_ASSUME_NONNULL_END | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -152,7 +152,8 @@ - (void)prepareToPlayAsset:(AVAsset *)asset withKeys:(NSArray<NSString *> *)requ | |
NSError *error = nil; | ||
AVKeyValueStatus keyStatus = [asset statusOfValueForKey:key error:&error]; | ||
if (keyStatus == AVKeyValueStatusFailed) { | ||
NSLog(@"Asset loading failed with error: %@", error); | ||
NSLog(@"Asset loading failed with error: %@", error); | ||
[self.delegate videoNodeDidFailToInitAssetFor:self withError:error]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we pass along the asset and maybe the key at hand? I imagine those objects might be helpful for investigations. Should be something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Btw, please use 2 spaces for indentation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Everything is updated. |
||
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reserve the old indentation.