DZ.player.prev() not working Deezer API - deezer

Loading the player with DZ.player.playTracks, the command DZ.player.prev() works fine. But if i use DZ.player.addToQueue to add tracks to the player, the command DZ.player.prev() does not work, it does not return to the previous song.

Related

Is there a way to implement add to queue and play next feature in video playing app?

I am building an app to play video like in youtube. Now I need to implement the play next and add to queue feature. I am using video_player 2.4.8 and chewie package. For the add to queue feature I created a List in Provider and played the video from next index as soon as the current index video had completed playing but now I found out that while in full screen mode the next video does not play when the current song completes playing but in normal screen it does. Could anyone help me with this and also what would be the best approach to implement add play next feature.
I maintained a List of songs to be played in provider and removed the first song of queue once it started playing.
void removeFirstSong() {
songQueue.removeAt(0);
updatedSongQueue.removeAt(0);
notifyListeners();
}
Then I played the first song from list after the current video completed.

How to use vuforia in unity with sound

I have a problem using vuforia with unity, I have 10 videos in database and when I start the App the sound from the videos start playing immediately even if there is no cards to read from.
Check you AudioSource components are on the target object, so it gets disabled.
If this happens and you still have the problem, add custom code so that it gets muted on OnTrackingLost and unmute in OnTrackingFound.
The class you are looking for id DefaulTrackableEventHandler, you can inherit from that one and add that code instead to our target using overrides or add code there like GetComponent.

Unity VideoPlayer and WebGLMovieTexture cant play two videos in a row

I'm trying to play videos in Unity WebGL in the browser, but having lots of problems.
I tried two different video players and none of them work fully.
The WebGLMovieTexture player works like this
public WebGLStreamingVideoPlugin _videoPlugin = new WebGLStreamingVideoPlugin("http://www.example.net/video.mp4");
_videoPlugin.Play();
Basically when you want to play a video you create a new instance and give it the URL like above, and it plays great!!
The problem is when you want to stop that video, and play a different video, it seems impossible because there is no way dispose of the first video because there is only a Stop() in the API, which stops the playback but it continues to stream the video data from the internet in the background.
There is no way to delete the instance because Destroy() cant be called since that WebGLMovieTexture is not derived from monodevelop, and C# does not seem to give a way to delete an object (how silly). Even setting it to null doesnt do it, it continues to stream the video in the background.
So if you create a new instance in order to play a different video, you end up with TWO video streams, and if you do it again to play a third, you end up with THREE, and so on, so quickly you can see how bad that will end up.
My question is how to dispose of or destroy the first WebGLMovieTexture player, or maybe tell it to stop streaming the first video and start playing a different one?
The second player I tried is the VideoPlayer for WebGL in Unity Version 5.6.0b4, with this one I can only get it to play a video if I hardcode the URL in the inspector, if I put the URL in code it doesn't play it in the browser.
vPlayer = gameObject.GetComponent<UnityEngine.Video.VideoPlayer>();
if (vPlayer.isPlaying) {
Debug.Log("STOPPING PLAY");
vPlayer.Stop();
}
vPlayer.url = url;
vPlayer.isLooping = true;
vPlayer.frame = 0;
vPlayer.targetCameraAlpha = 1F;
vPlayer.Prepare();
vPlayer.Play();
And to get it to play a second video I suspect I will have the same problems as the other one.
Anybody have any ideas that can help me?

DZ.player.prev() failing silently

Sometimes when I use DZ.player.prev() the command fails silently. It is not a problem with my code, since I tested using the commands on the console.
I try to use DZ.player.prev(), and the player does not return to previous song. The player is not on repeat or shuffle mode. I also check to see if is there a previous song on the player with DZ.player.getTrackList() and DZ.player.getCurrentIndex().

AirPlay flickering when switching between movies

I have an app that shows list of movies in a table view. When I play them one after another on device it works just great. But when I switch to Apple TV over AirPlay it doesn't work anymore. It play's the first video on ATV ok but after a switch to the next video the screen on ATV start blinking/flickering and after a few seconds it falls back playing on a device. I am using MPMoviePlayerController for playing stream videos.
I also found out that if previous video finished playing over AirPlay it tries to start the next one over AirPlay also. Is this intended behaviour?
Is this kind a related with property allowsAirPlay?
I think I've found a solution. Before you switch playing another video you should stop the previous one:
[self.moviePlayer stop];
This is not needed if you are not playing via AirPlay cos the next video will automatically stop previous one by nature - you can not play two videos at once.
But If you do play video over AirPlay you need to stop previous one first and than play the next one.
This solution works for me.