If you use setVolume() to lower the volume of the SoundCloud widget, when the SoundCloud player plays the next song, it resets the volume to 100.
You can reproduce the problem on the SoundCloud API playground page.
https://w.soundcloud.com/player/api_playground.html
To reproduce:
start playing the song
set the volume to 20
press "get volume" (shows 20)
press "next"
press "get volume" (shows 100)
Related
May be a list of duration in seconds is declared, on attaining the duration, player should pause and show a dialog to the user. If user's answer is success, the video should continue playing, else video should seek to last success answer position if exists else into starting position.
I've tried with different video players with adding listener and seekTo() methods of those players, but
failed.
I have tried with:
1.pod_player: ^0.1.0
result: The player not responding , with audio continuing and video paused.
2.video_player
result: The listener is not working.
I've tried multiple flutter plug-ins to stream and play and pause music but as of currently, I haven't yet figured out a simple way to implement play and pause, whilst having the ability to avoid music overlapping, I want so that when the current song is playing, if I were to press play on new music track, the current song playing will stop and play the newly pressed song. I've tried flutter_sound, audio player, audio file player, and flute music player but I can't seem to figure out how to do this.
If it is possible either using one of these or a new plug-in, is there a way to implement what I have just described.
The library you seek is more of a multi-track player than a player. Which does not currently exists AFAIK.
The simplest way is to act according to the status of the tracks (which should be given by the player).
Roughly, what I suggest: have something that keeps the status (e.g. paused, playing, completed) of each track. (e.g. List of Tracks) When you press play on track 2 or track 1 finishes playing, you set to 'completed' (or as you wish) the track 1 and set to 'playing' the track 2.
Have a listener on the status of the current track and voila (for autoplay). When the track completes, notify the listener to call a function to start the next one on your list. When you press another track, set to 'completed' the current track and to 'playing' the track you pressed, then notify listeners.
Any library letting you know the status of a track is good enough for your purpose.
I'm trying to build a music player app in xcode, but I'm having trouble when changing the playlist (a.k.a. the music player queue). Any time I change something in my playlist (i.e. when addind songs or changing song order, or when pressing the "next" button, etc.) I always seem to have to execute these tow lines of code:
[self.musicplayer play];
[self.musicplayer pause];
apparently, the music player only really registers changes when i send it the "play" command; soon after, i have to send it "pause", so that the song won't actually start playing.
without these lines of code, i would have the following problem (among others):
I would have, say, 6 songs, named "1" through "6". song 1 was playing, but i paused it. I then pressed the "next button" 3 times, which executed the following code (3 times):
[self.musicPlayer skipToNextItem];
therefore, by my logic, the music player should have song number 4 as its current playing song; but when I pressed play, song number 1 would start playing, as if it hadn't noticed I pressed "next".
I was only able to solve the problem by telling it to play and pause, as described above, but that was a very ugly solution, to say the least. also, in some cases, the ipod would play the first seconds of the song before processing it had to pause right away, and that was pretty bad :p
Does anyone know the correct way I should be doing this?
I am using Xcode 4.2.5 preview, and testing it on an iphone 4s with ios 6.
I have a UIWebview which will play a YOUtube video playlist, and I need to handle the events when user click DONE button and close the webview.
So far, the working solution i found is to handle UIMoviePlayerControllerDidExitFullscreenNotification, but when UIWebview finish playing a video in the list it will exit the fullscreen mode and enter back to fullscreen mode to play the next one. My app handles the event of exiting fullscreen as pressing DONE button and only the first song of the list get played.
My question is that is there anyway to handle DONE button click events without handling UIMoviePlayerControllerDidExitFullscreenNotification, or to handle those two events separately?
I have an iPhone app that plays tracks through an AVPlayer, and separately want button click sounds. I first used AVAudioPlayer for the clicks and this works fine except I don't want the 'Play' icon in the status bar to appear every time the user clicks a button and the click sample is played.
I turned my attention to System Sounds, which I read has limitations in that you cannot directly set the volume. However, I am seeing strange volume behaviour which makes me wonder if I can:
NSURL *clickURL = [[NSBundle mainBundle] URLForResource:#"click" withExtension:#"wav"];
SystemSoundID clickSoundID;
AudioServicesCreateSystemSoundID((CFURLRef)clickURL, &clickSoundID);
AudioServicesPlaySystemSound(clickSoundID);
If I click a button before playing a track the volume is set to the phone ringer volume. However, after playing a track using AVPlayer the volume is set to the player volume (as I would like it to be).
Any ideas how I can make the System Sound sample take on the app volume level regardless of if AVPlayer has been in action first? Alternatively is there a way to disable play icon notifications in the status bar?
You need to set the correct AVAudioSession. There is one called solo ambient which will not do the play button I think. Can't be more detailed at the moment, because I'm on my phone. (will fix later with a more fuller description)