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

added error reporting callback to ASVideoNode #260

Merged
merged 3 commits into from
May 11, 2017
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
- [ASDisplayNode] Pass drawParameter in rendering context callbacks [Michael Schneider](https://github.com/maicki)[#248](https://github.com/TextureGroup/Texture/pull/248)
- [ASTextNode] Move to class method of drawRect:withParameters:isCancelled:isRasterizing: for drawing [Michael Schneider] (https://github.com/maicki)[#232](https://github.com/TextureGroup/Texture/pull/232)
- [ASDisplayNode] Remove instance:-drawRect:withParameters:isCancelled:isRasterizing: (https://github.com/maicki)[#232](https://github.com/TextureGroup/Texture/pull/232)
- [ASVideoNode] Added error reporing to ASVideoNode and it's delegate [#260](https://github.com/TextureGroup/Texture/pull/260)
10 changes: 9 additions & 1 deletion Source/ASVideoNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -147,6 +147,14 @@ NS_ASSUME_NONNULL_BEGIN
* @param videoNode The videoNode
*/
- (void)videoNodeDidRecoverFromStall:(ASVideoNode *)videoNode;
/**
* @abstract Delegate method invoked when an error occurs while trying trying to load an asset
* @param videoNode The videoNode.
* @param key The key of value that failed to load.
* @param asset The asset.
* @param error The error that occurs.
*/
- (void)videoNode:(ASVideoNode *)videoNode didFailToLoadValueForKey:(NSString *)key asset:(AVAsset *)asset error:(NSError *)error;

@end

Expand Down
1 change: 1 addition & 0 deletions Source/ASVideoNode.mm
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ - (void)prepareToPlayAsset:(AVAsset *)asset withKeys:(NSArray<NSString *> *)requ
AVKeyValueStatus keyStatus = [asset statusOfValueForKey:key error:&error];
if (keyStatus == AVKeyValueStatusFailed) {
NSLog(@"Asset loading failed with error: %@", error);
[self.delegate videoNode:self didFailToLoadValueForKey:key asset:asset error:error];
}
}

Expand Down