Soundcloud API play event fired but not counted - soundcloud

I'm using a standard Soundcloud widget to run an embed song playback in our ads unit:
var scWidget = SC.Widget(scPlayer);
var songClicked = false;
scWidget.bind(SC.Widget.Events.READY, function() {
scWidget.bind(SC.Widget.Events.PLAY, function() {
if(!songClicked){
AdvertEvents.counter('Song Play');
songClicked = true; // make sure only count one play per load
}
});
});
Basically I'm adding a play count tracker to our system whenever the song starts playing using the Events.PLAY event. This should be equal to or fewer than the playcount on Soundcloud. But the 'Song Play' counter in my system appears to be higher than actual play count on Soundcloud (5k 'Song Play' events recorded in our system vs 3k playcounts on Soundcloud). What could be the problem here? Doesn't the PLAY event mean the song should be counted as one play on Soundcloud? Thanks a lot for your help.

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.

Audio volume change is lagging

Im playing two tracks in sync. This works well, they sound like one song.
What im trying to do is allow player to switch one track on and of by toggling mute or setting volume to 0 or 1. The muted track continues playing in sync with other track but cant be heard.
But the volume change /muting is lagging. So even if you switch the sound on exactly on beat you wont hear that beat cause it takes a split second for the code to react. There must be a way to make the change instant?
Below is a part of the music manager that handles this. The full code also includes how sound is loaded and starts playing and can be seen here:
https://github.com/Lautaro/AudioTest/blob/master/Assets/MusicManager.cs
// Update is called once per frame
void Update()
{
if (Input.anyKeyDown)
{
if (Input.GetKeyDown(KeyCode.Space))
{
Toggle();
}
}
}
void Toggle()
{
var clip = Sources.First(s => s.clip.name == "ExtraBeat");
// Same result if setting clip.volume instead of mute
clip.mute = !clip.mute;
}
The complete project with audio tracks can be cloned here. Use space to toggle sound.
https://github.com/Lautaro/AudioTest.git

How to display the big play button in the Azure media player?

I'm new to the Azure media player.
I would like for the big play button to appear whenever the video is paused. I can see the element in the html, just not sure how to make this happen.
Thanks!
I agree with #vince in the answer, But the Big play Button wont go away when we want to play the paused video
so here you should do the following
myPlayer = amp(id, playerOptions, function() {
console.log('Good to go!');
this.addEventListener('pause', function() {
jQuery(".vjs-big-play-button").show();
});
this.addEventListerner('play', function(){
jQuery(".vjs-big-play-button").hide();
});
});
Add this code on your pause event.
$(".vjs-big-play-button").show();
Let me know if it works.

spotify player plays old track for some moments in iphone

I implemented Spotify in my application using CocoaLibSpotify library. I am playing spotify songs from different pages of my app. The problem is, after I played a song then when I try to play another song from another page, it plays the old song for some moments.
This is some code sample.
self.playbackManager = [[SPPlaybackManager alloc] initWithPlaybackSession:[SPSession sharedSession]];
self.playbackManager.playbackSession.playbackDelegate = (id)self;
[self.playbackManager playTrack:track callback:^(NSError *error)
{
if ((error || ([track availability] != SP_TRACK_AVAILABILITY_AVAILABLE)))
{
}
else
{
}
}];
Please help me to fix the issue.
It sounds like you're creating a new playback manager for each page of your app. Don't do this, or they'll overlap one another.
Have only a single playback manager in your whole app - that way, when you play a new track using playTrack:callback:, the new track will replace the old one instantly. Note that you do not set the currentTrack property directly - it's read-only.

How to play several Videos in sequence way?

I am trying to make one app to play several videos sequentially, for it, I have seen the Katura HTML5 Video Player to do it and I would like to ask you if it is Samsung SDK compatible or it is not which HTML5 Video Player is Samsung SDK compatible?
Thanks in advance
Alejandro
A simple way to do this would be to create an array with the videos to play and utilize the OnRenderingComplete callback in the player plugin to play the next video in the array when the current video finishes. Roughly something like:
var videos = ["url1", "url2"];
function playNext() {
if (videos.length > 0) {
url = videos.shift();
player.Play(url);
} else {
//Playlist is over
}
}
player.OnRenderingComplete = 'playNext';