ios - How do I play video using MPMoviePlayerController over WWAN networks? -


i have mpmovieplayercontroller takes link , plays video off link. using wifi presents no problem, video played , well.

using 3g network however, hangs few seconds before throwing mpmovieplayerplaybackdidfinishnotification, localised description of 'the operation not completed'.

my code follows:

    videoplayercontroller =  [[mpmovieplayercontroller alloc]                  initwithcontenturl:url];      [[nsnotificationcenter defaultcenter] addobserver:self                                          selector:@selector(movieplaybackdidfinish:)                                              name:mpmovieplayerplaybackdidfinishnotification                                            object:videoplayercontroller];      [[nsnotificationcenter defaultcenter] addobserver:self                                          selector:@selector(willenterfullscreen:)                                              name:mpmovieplayerwillenterfullscreennotification                                            object:videoplayercontroller];      videoplayercontroller.controlstyle = mpmoviecontrolstyledefault;     videoplayercontroller.shouldautoplay = yes;     videoplayercontroller.repeatmode = mpmovierepeatmodeone;      cgrect rect = _documentviewer.frame;     [videoplayercontroller.view setframe:rect];     [self.scroller addsubview:videoplayercontroller.view];     [videoplayercontroller setfullscreen:no animated:yes]; 

as mentioned, works fine using wifi connection, doesn't doing same on 3g. video 26.8 mb off specific url. 3g limit amount can download @ once on ios? there alternative play videos on 3g networks?

thank time!

to serve video file on slow network, should using http live streaming (hls).

your code need not change, url call should point stream's index file. index file amounts playlist of individual (often 10 second) mpeg transport stream files.

explore details on apple's http live streaming page, or overview , list of server software @ wikipedia.

as aside, don't show declaration of videoplayercontroller, need make sure it's property of view-controller, or in way make sure lifetime going long video being played for.


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -