-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
[video_player] seamless looping on iOS #72878
Comments
I tried to use _player = [[AVQueuePlayer alloc] initWithItems:@[item]];
_player.actionAtItemEnd = AVPlayerActionAtItemEndNone;
_looper = [AVPlayerLooper playerLooperWithPlayer:_player templateItem:item]; But for some reason, adding the looper makes player never load and never register the observers, so app also crashes on player disposal (though, if I comment the looper instantiation line, all works fine) |
could someone please take a look at this by any chance? |
@nt4f04uNd |
@darshankawar added |
Issue replicable on latest master on iOS. 72878_android.mov72878.movflutter doctor -v
|
i tried to implement this with two ways:
AVPlayerLooperi had no luck in achieving seamless playback with with class. i wired it up to create multiple AVPlayerItemVideoOutputs (this SO question helped me with this https://stackoverflow.com/questions/65802373/how-to-use-avplayerlooper-with-avplayeritemvideooutput), and it is rendering fine, but for some reason, there's still a hiccup in looping i'm not sure why this happens. was testing this on my iPhone 7, so this might either be sort of Apples bug, or there's still some expensive operation i missed that causes that implementation is here https://github.com/nt4f04uNd/plugins/tree/looper memory usage AVMutableCompositionhere we just compose our asset to be played a lot of times (for example 500) and it seems to be looping seamlessly. however, this disables an optinos of easy turning on and off implementation is here https://github.com/nt4f04uNd/plugins/tree/composition memory usage as we can see, there seems to be no difference in memory usage |
any updates on this? thanks |
Are there any updates on this? |
Are there any updates on this? |
Hi all - Is there any update on this issue? That would be greatly appreciated given that background loop videos are very common and the issue has been opened 3 years ago. Here's my workaround I am making an indie game RPG with Flutter and using background video loop for multiple screens. In my Flutter code I also set the video on loop with the same criteria so the hiccup issue is now only occurring on looped videos at the 500th iteration which the player will very likely never noticed, like so: Add the following code in:
|
@darshankawar @Hixie @cyanglaz @luanpotter @spydon |
I am not connected to any video stuff in Flutter at all, I've honestly never even used video in Flutter. 😅 |
@Hixie Can you please change the label to "found in release: 3.10.5" currently this case is tagged to "found in release: 1.26", maybe this is why it wasn't looked at for years? Thanks. |
Happy to add that but we don't use those labels for prioritising. We use thumbs-up emoji on the first comment, and general judgement regarding the importance of an issue. See https://github.com/flutter/flutter/wiki/Issue-hygiene#when-will-my-bug-be-fixed |
Thanks @Hixie for your reply. I didn't know about the thumbs up ranking. Hey @spydon @zhouyuanbo @TobiasDuelli @rgillera @nt4f04uNd - can you put a thumbs up on @nt4f04uNd top comment dated Dec 2020 ? That would help bump the issue. |
I have this issue as well. I think loops should made with AVPlayerLooper. |
Recently I tried debugging my looper implementation, but couldn't find the reason the hiccup still occurs. The branch with the implementation Although, I recorded a trace in XCode and it is evident there is a CPU workload spike in places where video goes into new loop. Perhaps this spike is the reason of the hiccup |
There is no fork that I know of. The only chance it'll get resolved is if the count of 👍 on OP post get this issue noticed, or if the flutter team dev or another contributor pick up the issue. |
Flutter
video_player
plugin doesn't useAVPlayerLooper
, forsetLooping
which causes a small hiccup in playbackhttps://github.com/flutter/plugins/blob/622ba57c3960e511bdd4adabe800aef844e263fc/packages/video_player/video_player/ios/Classes/FLTVideoPlayerPlugin.m#L97-L106
Minimal reproducible:
https://github.com/nt4f04unds-archive/issues/tree/flutter_72878
The text was updated successfully, but these errors were encountered: