Comments (10)
Swift Example:
player = AVPlayer.init(playerItem: playerItem)
player.automaticallyWaitsToMinimizeStalling = false
Obj-C Example:
_player = [[AVPlayer alloc] initWithPlayerItem:playerItem];
_player.automaticallyWaitsToMinimizeStalling = false;
Should be where the player item is init
from just_audio.
I would consider adding an iOS-specific option, with the current behaviour being the default.
from just_audio.
Yeah even if it is added as a option that would be great. It helps a lot with loading remote audio files quicker on iOS.
I have used this to reduce some urls which take 10+ seconds to start playing down to 3 seconds to start playing the audio file.
from just_audio.
I have made a PR that implements this feature. Can you try it out on my branch? @YaarPatandarAA
from just_audio.
Notice that you need to call this method AFTER setting the url, or else the AVPlayer
instance in iOS native will be null before you set this option, rendering it useless
from just_audio.
@Camerash Although I haven't used this method yet, I believe it should still be useful in the spirit of @YaarPatandarAA 's example code if you call it after calling setUrl
but without awaiting the result of setUrl
.
Another way to make the code more robust could be to allow this method to be called before setUrl
. On the iOS side, define a new boolean field to store the set value of this flag, and conditionally, if setUrl
has already completed (by inspecting the state), set the automaticallyWaitsToMinimizeStalling
property on the player. Then in the iOS implementation of setUrl
, if the flag has been set, then set the automaticallyWaitsToMinimizeStalling
property on the player. That way, automaticallyWaitsToMinimizeStalling
will either happen immediately if called after setUrl
has completed, or it will just record it effectively as pending and will be processed on the next setUrl
.
from just_audio.
@ryanheise I have implemented your suggestion to make the feature more robust 🙏
from just_audio.
@Camerash works like a charm. Grabbed it from you branch and tried it out.
@ryanheise can we please get this implemented. I would like to use this in my app.
from just_audio.
Thanks @Camerash , I have now merged this PR and it is published in version 0.1.1. @YaarPatandarAA please feel welcome to reopen if the released version does not work.
from just_audio.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs, or use StackOverflow if you need help with just_audio.
from just_audio.
Related Issues (20)
- web play audio error HOT 3
- [GETX] Info: _GetImpl Instance of '_GetImpl' runZonedGuarded: Loading interrupted HOT 2
- Provide Raw Audio Data Capture from AudioPlayers HOT 3
- [IOS] Can not take duration of audio url, but can play it HOT 2
- repeat listening to the currentIndexStream even after reaching the end of the list HOT 2
- Specify an AudioPlayer for just_audio_background HOT 2
- Request for ios audio category ambient setting feature HOT 2
- Supporting web 1.0.0 on just_audio_web HOT 1
- Supporting web 1.0.0 on just_audio_web HOT 1
- Supporting web 1.0.0 on just_audio_web HOT 4
- PlatformException(-1001, The request timed out., {index: 2}, null) HOT 1
- PlatformException(-1001, The request timed out., {index: 2}, null) HOT 1
- PlatformException(-1001, The request timed out., {index: 2}, null) HOT 1
- how to play audio which audiobytes from websocket HOT 1
- how to play audio which audiobytes from websocket HOT 2
- how to play audio which audiobytes from websocket files or assets,(Uint8List format) HOT 1
- play audiobytes from websocket is error
- Connection abort issue HOT 1
- Target kernel_snapshot_program failed: ProcessException: Operation did not complete successfully because the file contains a virus or potentially unwanted software. HOT 1
- conflict with cached_network_image and file_picker
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from just_audio.