Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8856985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:29:03+00:00 2026-06-14T14:29:03+00:00

Im making a radio streaming application, my app is working perfectly. I have two

  • 0

Im making a radio streaming application, my app is working perfectly. I have two buttons in my screen one for playing and the other for pausing, also I have a label that indicates the state of my player. I have no problem making this label show the state “Playing” or “Paused” my problem is that when I press the play button there is a time where the buffer is gathering information and I can’t figure out a way to show a “Buffering…” label before the player start to stream the audio.

This is the code Im using for streaming the radio station.

 NSString *url = [NSString stringWithFormat:@"http://66.7.218:8816"];

        player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]];
        player.movieSourceType = MPMovieSourceTypeStreaming;
        player.view.hidden = YES;
        [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
        [[AVAudioSession sharedInstance]setActive:YES error:nil];
        [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
        [player prepareToPlay];

        [player play];

Im usin a function I created called changeStatus and this function is called each second to identify the status of the player.

-(void)changeStatus
{   

    if (player.loadState == MPMovieLoadStateUnknown) {
        status.text = @"Buffering...";
    }
    if(player.playbackState == MPMoviePlaybackStatePlaying)
        {
            status.text = @"Playing.";
        }
   if(player.playbackState == MPMoviePlaybackStatePaused)
        {
            status.text = @"Paused";
        }

}

I really need to solve this problem and Ive tried all I can to solve it. Hope you can help me! Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T14:29:05+00:00Added an answer on June 14, 2026 at 2:29 pm

    I achieved to solve the problem. The part that was missing is the if clause which gives the signal to start playing only when the player is prepared to play. Without that the player starts to play before the buffer is completely loaded so it plays no audio. And that was the reason my Playing label showed immediately instead of the buffering one.

    NSString *url = [NSString stringWithFormat:@"http://66.7.218:8816"];
    
            player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL URLWithString:url]];
            player.movieSourceType = MPMovieSourceTypeStreaming;
            player.view.hidden = YES;
            [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
            [[AVAudioSession sharedInstance]setActive:YES error:nil];
            [[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
    
            [player prepareToPlay];
    
            if(player.isPreparedToPlay)
            {
            [player play];
            }
    

    Adittionally, the MPMoviePlaybackStateInterrupted refers to the buffering process while doing an stream. So if you want to make something happens in the buffering process refer to this method.

    -(void)changeStatus
    
        {   
    
            if(player.playbackState == MPMoviePlaybackStatePlaying)
                {
                    status.text = @"Playing.";
                }
           if(player.playbackState == MPMoviePlaybackStateInterrupted)
                {
                    status.text = @"Buffering...";
                }
    
        }
    

    Thanks a lot to the user That Guy who helped me solving this.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making the radio app.I have using the android media for playing radio
I am making an application for quiz. The contents text of the radio buttons
I am making a form in which I have 2 radio buttons rows. I
I am making an android app in which radio buttons are to be created
I'm making a quiz generator, and I have an HTML form with radio buttons
I have this javascript inside a rails app: <script type=text/javascript> var buttons = document.querySelectorAll('[data-radio-sub-questions]');
Im making an application which uses few languages. I would like to have possibility
i am making a form consist of radio buttons, and i am hiding the
I'm making an app where users can write reviews on venues and currently have
I have a requirement when a user clicks a specific arrangement of radio buttons

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.