objective c - iOS - Video looping not working on iphone 4 -


i using mpmovieplayer play video in iphone application.

i want play video in loop means wants play single video repeatedly.

i using following code repeat video:

movieplayer.repeatmode = mpmovierepeatmodeone; 

it working on simulator , higher phone not working on iphone 4.

it not repeating video on iphone 4 device

is there specific reason that? there solution that?

my iphone iphone 4 updated ios 7

thank you

this solution have implemented:

i have used mpmovieplayerplaybackstatedidchangenotification notification

added following notification movie player

[[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackdidfinishedfromsetunderway:) name:mpmovieplayerplaybackstatedidchangenotification object:movieplayer]; 

notification method:

-(void)movieplaybackdidfinishedfromsetunderway:(nsnotification *)dict{      if (dict.object == movieplayer) {         nsinteger reason = [[dict.userinfo objectforkey:mpmovieplayerplaybackdidfinishreasonuserinfokey] integervalue];         if (reason == mpmoviefinishreasonplaybackended)         {             [movieplayer preparetoplay];             [movieplayer play];         }     } } 

done !!! working ... :)


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

How to provide Authorization & Authentication using Asp.net, C#? -