Search code examples
iphoneobjective-cios5mpmovieplayercontrolleravaudioplayer

MPMoviePlayer sound working in Simulators and ipad device, but not Working in iPhone Device


I have a problem with MPMoviePlayerController, i.e. I am playing the live stream url in (m3u8 format) MPMoviePlayer like below:

player = [[MPMoviePlayerController alloc] initWithContentURL:audioUrl];
        [[NSNotificationCenter defaultCenter] addObserver:self 
                                                 selector:@selector(loadStateDidChange:) 
                                                     name:MPMoviePlayerLoadStateDidChangeNotification 
                                                   object:player];
        if ([player respondsToSelector:@selector(loadState)]) 
        {
            // Set movie player layout

            [player setMovieSourceType:MPMovieSourceTypeStreaming];
            [player setControlStyle:MPMovieControlModeVolumeOnly];
            [player setFullscreen:YES];
            [player prepareToPlay];
            [player play];

        }
    }

It is working in both simulators & iPad device with ios 5 version, but it is not giving the audio in any iPhone device i have.

Please help me out... Thanks, in advance.


Solution

  • mr simham ... check this below url it help for us becoZ

    1. Call stream-url within mobile safari. If that has the same results, then your code is correct and the stream is not. It would be an incorrectly encoded audio stream then.

    2. it depends on bandwidth also below ref url regards to bandwidth check it once.... u r ref Stream URL prepare,according to BandWith

    REFERENCE URL: