In my Flutter game there is a grid of elements, every one of which plays a sound when being tapped (I use audioplayers library for that).
My issue is that when too many taps in a queue are being recognized, the whole app just freezes for a few seconds.
When I disable playing sound on tap, this problem seems to doesn't occur.
So what is the proper way to parallelize audio playbacks in such a cases?
Thanks.
The author of audioplayers library himselft answered my question.
For everyone who may face the same issue in future -- feel free to refer to this:
https://github.com/luanpotter/audioplayers/issues/388
In short: suggested solution is to use AudioPool tool from the Flame library. Please see the link above for details.
Related
I need to create the following video player for my app: Screenshot from Netflix. I need a start/pause button, a back button, the title of the video, and a time indicator. The video should also always be in landscape mode. I've already found a lot of video players in flutter but I haven't found a way to modify them. If anybody knows a good library, a tutorial, or has some source code it would really help me out, thanks.
I think your best bet is using the video_player package, as it's the most bare-bones package out there. You can make the player all to your liking by using the Stack Widget, having the video at its base and any other elements on top of it. It should be very doable; only the progress indicator is kind of complex, but it's not too bad.
I have been trying to implement YouTube like mini player in my flutter application and have stuck. Apparently previous Stack Overflow solutions of using mini player package have not worked out for be as the video disposes once I open video in full screen mode.
I have been following https://www.youtube.com/watch?v=umhl2hakkcY tutorial for achieving so but with the actual videos. I am using better_player for video playback.
Implementing the mini_player with better_player could become very hard because it would want individual controllers, what I found effective is to use https://pub.dev/packages/pip_view package and implement it from the page level.
This will give a much easier solution and a better pip.
I want to record screen video recording during application running and unfortunately apple didn't provide any scratch code on it.
The scenario is there a 'RECORD' button and a 'STOP' button. when I touch 'RECORD', I need to take a video of the entire gameplay (Screen Video) and stop recording when I touch 'STOP'.
Is there any other method besides the screenshot method to do this?
For example - Talking Tom, Angry birds, etc.
Instead of taking a video, you could record the user interactions and replay them. If you use a PRNG for random events, you should also make sure to seed it with the same value while replaying a game.
Screen capture in iOS has a few problems, one of which being performance, and the other being the fact that some animations are not captured because they happen at some low level, out of sight for normal screen capturing methods.
This, of course, will only replay the game on screen.
if we talk about angry birds, that has been developed in COCOS2D and if your game is also developed in cocos2d, you are lucky..!! Maybe if you dig-in you could find a way to use it with UIKit as well...who knows..!!
there is a cocos2d 3rd party utility named -Kamcord that can be used for recording gameplay.
kamcord.com
COCOS2D Kamcord archive link
We provide an SDK called "Everyplay" that allows you to do exactly what you're looking for. It's free to use, and is lightweight.
We provide out-of-the-box integrations for Unity3D, cocos2d (1.x, 2.x), cocos2d-x, and you can of course integrate to a custom OpenGL-based game engine.
The documentation is available at https://developers.everyplay.com/doc
The documentation contains an example app key to use when developing, but you can of course sign up for your own client key at https://developers.everyplay.com/
It's possible to do stuff like:
Reproduce a sound at a specified starting position
Reproduce a sound for a certain ammount of time
Using CocosDenshion ?
If so, how ?.
If not...i have any alternatives, like a different sound engine or a certain class in the SDK that would allow me to do both things ?
You can play positional audio with CocosDenshion. See this tutorial for example.
Of course you can also loop sounds, if that's what you meant by question #2. You can always schedule a timer and stop or (better) fade out the sound after a specified amount of time. Programming the timer is of course up to you.
As for an alternative I can highly recommend ObjectAL. It does everything CocosDenshion does and a few things more, plus its well documented and comes with an excellent demo app with examples for playing positional audio, looping sounds, using stereo channels with panning and fading sounds.
If you don't want to fumble with including a static library in your project have a look at Kobold2D, it comes with ObjectAL (and Cocos2D) already setup and ready to use.
From what I have gathered from internets the MPMoviePlayerController class doesn't support small video playback. So, in an effort to beat a dead horse I was wondering what kind of methods could be used to get a small video playing in a corner of the screen without interrupting the rest of the screen.
So far we've come across two solutions that may work: using a UIImageView and flopping images through it like a madman and using a large fullscreen video with all the animations we need already on it and skipping around as needed.
Am I wrong about the MPMoviePlayerController not supporting non-fullscreen video? Is their an easier solution than making UIImageView flip-books? Is cutting around a video a performance hazard?
I think you're stuck with flip books. Pretty sure the fullscreen video issue is a limitation of the hardware video decoder.
After researching for about 1 hour, I didn't find anything. It appears impossible to play video non-fullscreen on the iPhone. I didn't check for openGL ES though.
well.. i have been looking for and haven't found the alternate yet!
But there are some applications already does it!
check TVUlite from TVUNetworks
As I mentioned in another reply, this blog post http://www.nightirion.com/2010/01/scaling-a-movie-on-the-iphone/ mentions a method that will allow you to play non-fullscreen video. However, I'm not sure if this method will be approved by the app store verification process.