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 ability to set asset init options #71

Merged
merged 2 commits into from
Jul 12, 2019
Merged

Add ability to set asset init options #71

merged 2 commits into from
Jul 12, 2019

Conversation

dcvz
Copy link
Contributor

@dcvz dcvz commented Jul 6, 2019

Closes #68

Copy link
Owner

@jorgenhenrichsen jorgenhenrichsen left a comment

Choose a reason for hiding this comment

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

Good job 👍 Added a few comments, have a look at them when you got time 🚀.

@@ -36,6 +36,11 @@ public protocol InitialTiming {
func getInitialTime() -> TimeInterval
}

/// Make your `AudioItem`-subclass conform to this protocol to control enable the ability to set initialization options for the asset.
Copy link
Owner

Choose a reason for hiding this comment

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

Make your AudioItem-subclass conform to this protocol to control enable the ability to set initialization options for the asset.

Copy link
Owner

Choose a reason for hiding this comment

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

Maybe also link to these docs to make it clear what options are to be provided.

@@ -125,3 +130,24 @@ public class DefaultAudioItemInitialTime: DefaultAudioItem, InitialTiming {
}

}

/// An AudioItem that also conforms to the `AssetOptionsProviding`-protocol
public class DefaultAudioItemAuthorizing: DefaultAudioItem, AssetOptionsProviding {
Copy link
Owner

Choose a reason for hiding this comment

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

Change the naming of the class to DefaultAudioItemAssetOptionsProviding.

@@ -36,6 +36,11 @@ public protocol InitialTiming {
func getInitialTime() -> TimeInterval
}

/// Make your `AudioItem`-subclass conform to this protocol to control enable the ability to set initialization options for the asset.
public protocol AssetOptionsProviding {
func getAssetOptions() -> [String : Any]
Copy link
Owner

Choose a reason for hiding this comment

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

[String: Any] for consistency.

super.init(audioUrl: audioUrl, artist: artist, title: title, albumTitle: albumTitle, sourceType: sourceType, artwork: artwork)
}

public func getAssetOptions() -> [String : Any] {
Copy link
Owner

Choose a reason for hiding this comment

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

[String: Any] for consistency.

@@ -19,7 +19,6 @@ public enum PlaybackEndedReason: String {
}

class AVPlayerWrapper: AVPlayerWrapperProtocol {

Copy link
Owner

Choose a reason for hiding this comment

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

Probably not meant to remove this newline.

@dcvz
Copy link
Contributor Author

dcvz commented Jul 10, 2019

Fixed the issues @jorgenhenrichsen :) obviously I made this PR a bit too fast. Should all be good now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add option dictionary to the AVURLAsset.
2 participants