Closed iceman201 closed 7 years ago
Currently, there are delegate methods for pause and play. Delegate for when the video ends/loops would be good to have. I've been wanting to put an update to this project. Currently I was working on converting this to Swift.
What else would be desirable in the delegate (for the Objective-C project)?
func mediaViewWillPresent(_ mediaView: ABMediaView!) {
NotificationCenter.default.addObserver(self, selector: #selector(self.didPlayToEnd), name: .AVPlayerItemDidPlayToEndTime, object: nil)
}
func didPlayToEnd() {
print("hahaha")
}
Actually, I just figure out how to make it work. Since your ABPlayer is AVplayer, so it could just create an observe listener the AVplayer status. lol
I think your delegate has already cover quite large range usages. Awesome framework man
would be nice if it has something like "dismiss full screen after play til end of the video"?
I committed an updated to dev
- (void)mediaViewDidFinishVideo:(ABMediaView *)mediaView withLoop:(BOOL)didLoop;
And thanks for the compliment! This started as just a project to play around with the minimization idea, and I figured I could keep building on it. Still a lot that I want to do, I just got settled into a new job, so I plan on getting back to adding features to this.
To clarify on the feature you just proposed, you mean something like "dismissAfterVideoCompletion" and then after a video completes playing, the view will automatically close?
yes like that, Congratulation for your new job btw lol
is there anyway could dismiss that fullscreen manually???
Yes^ By calling
[mediaView dismissMediaViewAnimated:YES withCompletion:^(BOOL completed) {
// Executes after mediaView finishes dismissing itself
}];
Please refer to the "Calling the Manager" section of the Documentation
hm..... if i just do mediaView.sharedManager() it will return me error.
if i do ABMediaView.sharedManager() it gives me this
The function I just sent you is called on the mediaView itself, not on the shared manager. I've been thinking about moving that function in the docs, and adding a section for Presentation and Dismissal
even i use this postVideo.dismiss(animated: true, withCompletion: nil)
still doesnt dismiss when its playing in fullscreen.
Hmm I will look at this tomorrow, and I'll get a new version out to you with a few updates. Is that cool?
Cool awesome.
Thanks in advance
On 29/06/2017, at 1:08 PM, Andrew Boryk notifications@github.com<mailto:notifications@github.com> wrote:
Hmm I will look at this tomorrow, and I'll get a new version out to you with a few updates. Is that cool?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/AndrewBoryk/ABMediaView/issues/1#issuecomment-311833893, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AEy4dRs2mtgeg8XK51Cy2xbXmYMjTT6Jks5sIvkSgaJpZM4OGWap.
how to detect if the video play when it's end? didnt see any delegate on there