Note that there are some explanatory texts on larger screens.

plurals
  1. POAVPlayer not finishing the stream track
    primarykey
    data
    text
    <p>I am using AVPlayer to play long audio mp3 stream music (8 minutes), short musics (1 to 3 minutes) plays perfectly, but with these bigger musics the music starts playing, but after play some random minutes (between 2 and 3:20) the player starts the track again from the beginning. Although the player restart the music, the status information (duration and current time) keeps counting normally, without restart, just the audio restarts. Someone has an idea?</p> <p>The file I am playing is this: <a href="http://storage-new.newjamendo.com/download/track/57864/mp31/" rel="noreferrer">http://storage-new.newjamendo.com/download/track/57864/mp31/</a></p> <p>The player code:</p> <pre><code>AVAudioSession *mySession = [AVAudioSession sharedInstance]; // Assign the Playback category to the audio session. NSError *audioSessionError = nil; [mySession setCategory: AVAudioSessionCategoryPlayback error: &amp;audioSessionError]; if (audioSessionError != nil) { NSLog (@"Error setting audio session category."); return; } // Activate the audio session [mySession setActive: YES error: &amp;audioSessionError]; if (audioSessionError != nil) { NSLog (@"Error activating audio session during initial setup."); return; } player = [AVPlayer playerWithURL:[NSURL URLWithString:url]]; [player play]; </code></pre> <p>And here is how I track the information about the current time, that keeps counting normally.</p> <pre><code>AVPlayerItem *item = player.currentItem; CMTime duration = [item duration]; CMTime currentTime = [item currentTime]; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload