JS SDK Playlists, play them one after another - deezer

I'm building a custom player for my site and it loads a playlist, my question is: Can I load automatically another playlist after the first one is over? I looked in the events and in the player's controls and I can't find a way.
I tried player_paused but it works only when you hit the pause button, not when the player stops.
I hope you can help me.
Thanks in advance.

You have the track_end event, that will be triggered at the end of each track. You can just check the track ID that ended to know if it's the end of the playlist.

Related

Playing same audio on two players simultaneously using just_audio and just_audio_background

I am working on an app that plays audiobooks, and when you click a book in your list a full window player will start playing the book, however when you close/minimize it, I want a miniplayer to show right about the navbar in the bottom. This player has to continue playing from where the first player "stopped" until the user decides to pause.
Im unsure if this can be achieved without having to have both play the audio at the same time? Reason is that when the Fullscreen is closed, player.Dispose is called.
I currently have a function which saves the position of the player and stores it in shared pref, it however cuts the seconds of, so even if I called that in the miniplayer, it wouldnt continue from the same position.
Im new to flutter/dart btw, with only a few months experience. Thanks in advance
You should use a single player and then have two player "widgets" displaying the state of that same player. That way, you don't need to try to stop and start the player - the player can continue playing the whole time while the widgets are the only things changing.
If you're a beginner, the simplest way to define a single player that can be referenced from everywhere is to define it in a global variable, outside of any class declarations (for something more advanced, read about the service locator pattern):
final player = AudioPlayer();
Then let's say you have two widgets to view the state of the same player: FullPlayerWidget and MiniPlayerWidget. They can both reference the same player instance defined above.
Finally, your logic error is that you are calling dispose when minimising the full player widget. You shouldn't do that unless you want the audiobook to stop playing permanently. You don't want it to stop permanently, and you don't even want it to stop at all!
Actually, the only thing you want to happen when minimising is a visual thing. You want to hide the full widget and display the mini widget. But on the audio side, you want the player itself to be unaffected, continuing to play audio as if nothing had happened. Therefore, in this event you should in fact not call any methods on the player.
The best thing you can do as a beginner is to study lots of examples. E.g. podcastproject (although its dependencies are a bit out of date now).

jPlayer doesn't play audio file automatically in iPad

I am trying to play audio file using jPlayer in iPad. It works fine in Safari on my local PC but when I tried to open it in my iPad it doesn't play audio automatically.
Please help me.
Thanks
You may have to initialize jPlayer on user action in Mobile Safari.
The first time a media element is played must be initiated by a user gester. ie., The user must click the play button. This affects the operation of a jPlayer("play") in the ready event handler. The browser will ignore the command. jPlayer will simply wait until the user presses the play button.
Once the first gesture has been received, JavaScript code is then allowed to do whatever you want with the media element. Note that a jPlayer media player instance uses a audio and a video element. Each require their own gesture.
As a hack, you could possibly add a handler for a touch event on an outer container element (or body) and initialize any jPlayer instances that you want.
Ref: http://www.jplayer.org/latest/developer-guide/#jPlayer-known-issues-event-driven
Do you mean it doesn't play automatically? Because if it does, I don't see what your problem is.
Check if you have entered the correct path for option swfPath.

is it possible to change URL dynamically inMPMoviePlayerController

I am using MPMoviePlayerController to stream movie from the internet. And now my first application start to look nice :) BUT :) I have 4 URLs to stream (different movies), and I wan't when I tap to the movie to stop current movie and play another from another URL. Like changing channels on TV. I know how to catch tap, but I don't know how to change URL and start to play movie from that URL (like TV), any help?
I have used this tutorial to make application.
I think setContentURL is the function you're looking for. See:
Apple Documentation on MPMoviePlayerController
use [self.moviePlayer setContentURL:newUrl] to show the next video/movie. It is given in the Apple Documentation on MPMoviePlayerController. :)

How to keep MPMoviePlayerController open after movie ended?

If I use MPMoviePlayerController to play video in my iPhone app, it opens, loads the movie, plays it and then closes. Is it possible to force it to stay open after the movie finishes, so that user can replay it using its controls, instead of using controls in parent view? Also, is it possible to start MPMoviePlayerController in the paused mode?
thanks for any advice.
None of that is possible using the available API in the Pre-3.2 OS. One thing you could do is take a scerenshot of the last frame and stick that behind the movie so when it's done playing, it looks like it's still there, then just stick a button on it to replay. you could make an interface that looks/behaves similar to the standard movie player interface just for the play button if you need to.
For anyone stumbling over this now... There is a way to do this. Check out this question :)

MPMovie player how to get the amount of time played?

I was trying to go through the iPhone's sample code for mediaplayer.
I want to be able to capture the amount of time the media player has played the video. The duration at which the media player has stopped. Is there a method or property that will tell me the duration of play of the media??
Unfortunately the current API for MPMoviePlayerController allows basically no control. You can tell it to play and stop... otherwise where's a delegate method so you can be notified when the movie finishes playing and that's it, there's no additional controls. (a real bummer)
However, while we cant discuss the new 3.2 SDK yet, I'll give you a tip and say go look at the documentation of MPMoviePlayer in 3.2 and I think you'll be happy.
http://developer.apple.com/iphone/prerelease/library/documentation/MediaPlayer/Reference/MPMoviePlayerController_Class/MPMoviePlayerController/MPMoviePlayerController.html
moviePlayer.currentPlaybackTime
It's not possible to do KVO on it but you could do like me and create an scheduledTimer which updates every second to check what the current playbacktime is and update your graphics accordingly :)
Yes, You can use the property "duration" defined by MPMediaPlayerController. Plese try it out and check the output. U can refer the here duration property