How can I control lottie animation in flutter - flutter-animation

I have a custom made lottie animation for an app I am working on. I want this animation to play only one time. I was following a YouTube tutorial that I found online; however, when I follow it as is I receive an error (while the user in the YT video does not).The error that I receive says "LateInitializationError: Field '_screenController' has not been initialized.

Related

Push to next vc. wkWebView

I have a wkWebView where I display a video. How can I automatically switch to the next screen after the video ends?
It doesn't look like WKWebView has any call back methods to notify when a video has completed. The only suggestions I can provide is if the video lives locally in the app, you can use AVFoundation and take advantage of their call back methods. Other users have also mentioned using Javascript to detect when an online video has finished.

How do I keep my video player working in flutter?

When I use the video_player plugin, I use the Navigator.push function to go to another screen where I push a button to display the video. Once the video is over, I push the back button. If I activate the Navigator.push function again and push the button to display the video, no visual is shown and only the audio is played. Can someone tell me what is going on and how to fix this?
Never mind, I found out that the issue was that I needed to call setState before I could display the video the second time.

Record video inside of iOS app, immediately play and loop

I'm looking for a way for my users to take a video (defaulting to front facing camera, but with the ability to switch) lasting 2 seconds, display that video immediately and have it loop indefinitely (no controls displayed). Essentially mimicking a 2 second gif. I would like to do this in app so they can see the video before posting, and potentially retake. Any ideas? I've found some functionality here: https://developer.apple.com/library/ios/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/index.html#//apple_ref/c/tdef/MPMovieControlStyle but it doesn't seem to address the entire problem set.
Checkout this guide from Apple:
Using Video

Siri voice to Text breaks AVPlayer video

I have an app that is streaming Video data using an AVPlayer. The AVPlayer is using a APLEAGLView to render the pixels to the screen.
The issue I'm having is that I have a textbox within the same view. If you tap on the textbox and enter text with the keyboard it works fine.
However, if I use Siri's voice to text function on the textbox, then try play the video again, the audio plays and currentTime changes but the video is frozen on the frame that was there when you began the voice to text function.
This was fine previously but since a recent Apple update this is now broken.
Any help would be greatly appreciated as one of our biggest client's is complaining about this.
So I could not find the exact cause of the issue, but I did manage to fix it.
The issue was that the previous developers used an OPEN GL ES View to render the pixel buffer to the screen. I refactored it to use the standard AVPlayerLayer functionality and that fixed the issue.

Cordova - 'AVAudioSessionDelegateMediaPlayerOnly end interruption' error after pausing and resuming an app

This issue has arose using Cordova to play videos within an iOS application. I had thought to use the pause/resume feature to interact with the HTML5 video. However even when the video has stopped playing and the element has been set to display:none, or faded out etc, this error still appears in the console after the app is resumed - which then renders all video playing useless after it.
MP AVAudioSessionDelegateMediaPlayerOnly end interruption. Interruptor
<________-1874> category <(null)> resumable <0>, _state = 1
I have found issues relating to this, but are answered using C Objective for native app building.. and because I am using Cordova to build they do not apply unfortunately.
Has anyone else playing videos within PhoneGap/Cordova/Chrome Apps come across this and can offer a solution? Or anyone coding Native iOS apps could offer some advice as to why it is happening?
So to fix this (for anyone who may come across this in the future!), i had to resort to a bit of a hacky method.
When the Cordova iOS app is pushed to the background, and resumed, it looks as though any running video tags were unable to continue load and play video - the error above pops up in Xcode console and the video element is black no matter what. (I was fading still images on top of a video tag, then loading a new video using data attributes after a hotspot on the image is pressed). So when the app is paused I had to use JS/jQuery to remove and on resume it re-creates the video element and used the last selected data attributes to pick up the info from where it left off..
Seems to work, and is surprisngly seamless! :)

Resources