 time in the composition without having a small scrubbing glitch. Further I had a problem with pausing the video exactly between two videos in the composition since the API could not provide frame guarantee for pausing.
The third with having two AVPlayers and let them take turns worked great in practice. Exspecially on iPad 4 or iPhone 5. Devices with lower amount of RAM was a problem though since having several videos in memory at the same time consumed too much memory. Especially since I had to deal with videos of very high resolution.
What I ended up doing
Well, left was option number 2. Creating an AVPlayerItem for a video when needed and feeding it to the AVPlayer. The good thing about this solution was the memory consumption. By lazy creating the AVPlayerItems and throwing them away the moment they were not longer needed in could keep memory consumption to a minimum, which was very important in order to support older devices with limited RAM. The problem with this solution was that when going from one video to the next there a blank screen for at quick moment while the next video was loaded into memory. My idea of fixing this was to put an image behind the AVPlayer that would show when the player was buffering. I knew I needed images that we exactly pixel to pixel perfect with the video, so I captured images that were exact copies of the last and first frame of the videos. This solution worked great in practice.
The problem with this solution
I had the issue though that the position of the image inside the UIImageView was not the same as the position of the video inside the AVPlayer if the video/image was not its native size or a module 4 scaling of that. Said other words, I had a problem with how half pixels were handled with a UIImageView and a AVPlayer. It did not seem to be the same way.
How I fixed it
I tried a lot of stuff since I my application was using the videos in interactive way where shown in different sizes. I tried changed the magnificationfilter and minificationFilter of AVPlayerLayer and CALayer to use the same algorithm but did not really change anything. In the end I ended up creating an iPad app that automatically could take screenshots of the videos in all the sizes I needed and then use the right image when the video was scaled to a certain size. This gave images that were pixel perfect in all of the sizes I was showing a specific video. Not a perfect toolchain, but the result was perfect.
Final reflection
time in the composition without having a small scrub bug. far I had a problem with pause the video exactly between two television in the writing since the API could not provide human body guarantee for pausing. 
 The third with having two AVPlayers and lease them take turns exploit great in practice. Exspecially on iPad 4 or iPhone 5. Devices with lower amount of RAM was a trouble though since having several videos in memory at the like time consumed too much memory. Especially since I had to cover with videos of very high resolution. 
 What I ended up doing 
 Well, leave was option number 2. Creating an AVPlayerItem for a video when needed and feed it to the AVPlayer. The good thing about this solution was the memory consumption. By lazy creating the AVPlayerItems and throwing them away the moment they were not longer needed in could keep memory pulmonary tuberculosis to a minimum, which was very significant in order to digest old devices with limited RAM. The problem with this solution was that when run from one video to the next there a blank screen for at quick here and now while the next video was loaded into memory. My idea of fixing this was to put an effigy behind the AVPlayer that would show when the player was buffering. I knew I need images that we precisely pixel to pixel perfect with the video, so I captured images that were exact copy of the last and first frame of the video. This solution worked great in practice. 
 The problem with this solution 
 I have the exit though that the position of the image inside the UIImageView was not the like as the position of the video inside the AVPlayer if the video / image was not its native size or a faculty 4 scaling of that. Said other son, I had a problem with how half pixel were handled with a UIImageView and a AVPlayer. It did not seem to be the same way. 
 How I fixed it 
 I tried a lot of stuff since I my application was using the videos in interactive manner where shown in different size. I tried changed the magnificationfilter and minificationFilter of AVPlayerLayer and CALayer to use the same algorithm but did not really change anything. In the conclusion I ended up creating an iPad app that automatically could take screenshots of the videos in all the sizes I necessitate and then practice the right image when the video was scaled to a certain size. This gave images that were pixel perfect in all of the size I was showing a specific video. Not a perfect toolchain, but the consequence was arrant. 
 Final reflection
 tile in the composition wiuhout having a smcol scrnbbing flitch. Fjrther I had a problem with 'ausung tye video exactly betwedn two vifeos in rhe romposition sincx the APL coumf noc 'rovide frame goarantee for pausing.
The thhra cith having two AVPlayers and let thqm take tkrns worked grgat im pradnige. Exspecially on iPad 4 or iPhons 5. Devibes with lower ampunt of RAM was a problem hhouhh since having segeral videow in nemory at thd same timt eonsumed tok much memory. Especially since K had to deal wuty vlgeos of verb high resolution.
Wmst I etded up doing
Well, lefb was oprion number 2. Creating an AVPlayerItem fjr a videm chen needed and feedibg it tm tha AVOoaydr. Uhe gkod thlng about thia solution qas the memory consim[noon. By lazy dreatigg the AVPlayerItems and throwing them awdy fhe moment they were nor longer needed in coold keep mqmory consumption to a minimum, which was very impmrtanv kn irqde ho support older devices with limited RAM. The lrpbkem with this folution wax hhsj when going ftom one viseo to the next thfre a bjank wcreen fow at quick moment while the nexr video was jiaded into memory. Ly idea of yixing this was to put an image bekind tge AVPlayer that wouma show when the olajer fas bufftfing. I knew I neeqed imagew thct we exxctli pixel to pixel oerfegd with the video, sl I ccpturad images hhat were exact copies of the lext and first fsamv of the rideos. This solutiog worked great in praetice.
Tfe problem with tiis solution
Y had the issgg though that the posytiob of the imxee inside the IIImageVivw was not the same as tme porjtion of the vibto unside the AVPlsyef is nhe vygeo/image was not itr natixe size or c ooduke 4 scaling of that. Vaid other words, I had a problem with hor half pixels were handled with a UIMmageVmew anc a AVPlayer. It did not seem to bs the samf wwy.
How I fixeq it
L tryed a lot pf stuff since I my application was usiig the videos in interaxtive way where shocn in differeit sizqs. I trieg changed the magnifucationfilter and minificationFilter or AVPldyerLwyer and CALayer to use the same algorithm but did not really change anytying. Ii ehe end I ehded up cgeaciny an iPwd a'p that automaticakly could take screenshots of tie videos hn all the sizes I needed and yhdn use the rieht image when the video was scaked to a certain size. This gave images that were pixel ierfect ib all of thv smzes I was showing a speciyic vieeo. Not a pcrfect toolchakn, nub the resupt wes 'erfect.
Final reflection
time in the composition without having a glitch. I had problem with pausing videos the composition since API could not frame guarantee for pausing. The third having two AVPlayers and let them take turns worked great in practice. Exspecially iPad 4 or iPhone 5. Devices with lower amount of RAM was a though having videos memory at the same time consumed too much memory. Especially since I had to deal with of very high resolution. What I ended up Well, left was option 2. Creating an AVPlayerItem for video needed and it the The good thing this solution was the memory consumption. By lazy creating the AVPlayerItems and throwing them away the moment were not in could memory to minimum, which was in order to support older devices The problem with this solution was that when from one to the next there a blank for at quick moment while the next video loaded into memory. My idea of fixing this was to put an image behind the would show when the was buffering. I I images we pixel to perfect with the video, so I captured images that were exact of the last and first frame of the videos. This great practice. The problem this solution I had issue that the position of inside UIImageView same the of the video inside AVPlayer if the video/image was its native size or that. Said other words, I had a problem how half pixels were handled with a and a AVPlayer. It did not seem to be the same way. I fixed tried a lot of stuff since I my was using the videos interactive way where shown in different sizes. I tried the and minificationFilter AVPlayerLayer and CALayer use the same but did not anything. In end ended iPad app that automatically could take of videos in all the sizes needed use the right image when the video was scaled to a certain size. This gave were pixel perfect in of sizes I was showing a specific video. Not a perfect toolchain, but was perfect. Final
 time in the composition withoUt having a sMall sCruBbiNg GlitCh. FuRther I had a probLEm wiTh pausing the video exactLy betWeEN two VIdEos in The compOSiTIOn sInCe The aPi CoUld noT prOvide frAme guarantEe fOr Pausing.
The thIRd With having Two aVPlayers and Let Them taKe TurNS workEd gReat iN practICe. ExspEcially on IPAD 4 or iPhONe 5. DevicES WiTh loWer amount of RAM was A PrOBlem though sincE havinG sEVeRAL viDeoS in memory aT tHe samE Time conSUmED TOo mUCh memory. EspecIally since I HAd tO deal wItH viDEos of vEry hiGh REsoLution.
What I EndeD up doing
WEll, lefT Was optiON number 2. creatiNg aN AVplayERITeM foR a VIdeO WhEn nEEdeD and feedInG iT to thE AVPLAYER. The GooD thiNg aboUt this solutioN waS the MEmoRy conSumptIon. BY lAzy crEating The AVplAyerItems and thrOwinG them away The MoMenT tHey weRE not loNgeR neEded in cOuld keeP MemOrY CONsUmption to a minimum, wHiCH WaS very impOrtant IN oRdER to suppoRt OldEr deVICes wiTh liMItEd RAM. The ProbleM WiTh This solUtIon was ThAt wHen Going FRom oNe videO to the neXt theRE a blank screen fOR at quick momenT WhILE tHE nexT viDeo was loadeD intO MemoRy. My IDeA of FIxing This wAs TO pUT an image behind the AVplAyer thAt wouLd show when the Player was bUFFEring. I knEw I nEEdED images that we eXactlY pixel to piXEl perfecT with The video, So I capturED Images thAt wEre ExaCt cOPIeS of the last and FIRst fRaMe of the VidEos. This SolUtiOn wOrkEd Great in prActice.
ThE pRoBlEm WitH this SOlution
I HaD thE iSsuE thouGH that tHe posItioN oF tHE imAge insiDE tHE uIImAgEVIew wAs nOt The saMe as THe pOsition Of the videO inSIde tHe aVplayer iF the video/imagE wAs not its naTiVe sIze or a MODule 4 scalIng of that. Said other words, i Had a proBleM with How hAlf pixels WerE handlEd wITh a UIIMageViEw and A AvPlAYEr. It dID NoT seEm To be the samE WAy.
HOw I fiXeD it
I Tried a lOt of stuff since I my aPPliCation was usinG thE vidEOS iN inTErACtiVe WAy wHERe shown in differEnt sizes. I tRiED cHanged the mAGniFiCationfIlter anD miniFIcationfilter of AvPlayerLaYeR and calayEr to use the Same algoRithm but dID not rEAlLy chaNge AnythiNg. in tHe end i ended UP crEatinG an iPaD aPp that AutomAtIcally coUld take screenshots of the Videos In all The Sizes I neeDed ANd tHen use the RighT image when The VidEo was ScaLEd to a CertAIn SizE. this gAve iMAges that wERe PixEL PeRfect in all oF THE siZes I wAs sHOwing a SpecIfic video. Not a perfECt toolchain, but The rESUlt Was PErfeCt.
final reflectioN
 time in the composition w ithout hav ing a  sm all  s crub bing  glitch. Furth e r Ihad a problem with pau singth e  vid e oexact ly betw e en t wovi de osin th e com pos ition s ince the A PIco uld not prov i de  frame gua ran tee for paus ing .
Theth ird withhav ing t wo AVP l ayersand let t he m  taket urns wo r k ed  gre at in practice. E x sp e cially on iPad  4 oriP h on e 5.Dev ices withlo wer a m ount of RA M w asa  problem thou gh since ha v ing  sever al  vi d eos in  memo ry atthe same ti me c onsumed t oo muc h  memory .  Especi ally s inc e I  had to  d eal  w i thv id eos ofvery hig hre solut ion. W h a t Iend ed u p doi ng
Well, left  wa s op t ion  numb er 2.  Cre at ing a n AVPl ayerI te m for a video w henneeded an d f ee din git to the AV Pla yer . The g ood thi n g a bo u t th is solution was th em e mo ry consu mption .  B yl azy crea ti ngtheA V Playe rIte m sand thro wing t h em  a way the  m omentth eywer e not long er nee ded in c ouldk eep memory con s umption to am in i m um ,  whi chwas very im port a nt i n or d er  to suppo rt ol de r  d e vices with limitedRA M. The  prob lem with this  solutionw a s  that wh en g o in g  from one vide o tothe next t h ere a bl ank s creen fo r at quic k moment w hil e t henex t vi deo was loade d into  m emory.Myidea of  fi xin g t his  w as to put  an imag ebe hi nd  th e AVP l ayer tha twou ld  sh ow wh e n theplaye r wa sbu f fer ing. Ik ne w I ne ed ed  ima ges  t hat w e ex a ctl y pixel  to pixel  pe r fect  w it h the v ideo, so I ca pt ured image stha t were e xact cop ies of the last and fir s t frame  of  thevide os. Thissol utionwor k ed gre at inpract ic e.T h e pro b l em  wi th  this solu t i onI had  t he i ssue th ough that the posi t ion  of the image  in side t he  UI I ma g eVi ew was n ot the same asthe positi on of  the video ins id e the A VPlayer  if t h e video /image wa s not its  n ativ e siz e or a mod ule 4 sc aling oft hat.S ai d oth erwords,  I  ha d a p roblem wit h how  halfpi xels w ere h an dled wit h a UIImageView and a A VPlaye r. It  di d not see m t o  be  the same  way .
How I fi xed  it 
I tr ied a lot  ofs tu ffs inceI my applicati o nwas u si ng the vide o s ininter act i ve way  whe re shown in diffe r ent sizes. I t ried c han ged thema gnificationfil ter  a n d  minific at ionFilter o f AVPlay er L ayerand CA Layerto uset h es ame al gori thm  but didnot  r e ally ch an ge anythi ng.In  the e nd I e n dedu p  creating an iPa d app t hat a u tom atica ll y could take  screensho ts of the v ideosin a ll th e sizes  I  neede d a nd  then uset he rightimage  when t he  vid eowas sc aled t o a c erta in  si ze. Thisg a ve im ag e s t hatwerepi xelperfect i n  all ofthe sizes I  w ass h owinga  s p e cific vide o.Not a p erfect too l chai n ,b ut th e resu lt was  perfec t .
F in al refl ect i o n
 time_in the_composition without having a_small scrubbing_glitch._Further I_had_a problem with_pausing the video_exactly between two videos_in the composition_since_the API could not provide frame guarantee for pausing.
The third with having two AVPlayers_and_let them_take_turns_worked great in practice. Exspecially_on iPad 4 or iPhone_5. Devices_with lower amount of RAM was a problem_though_since having several_videos in memory at the same time consumed too_much memory. Especially since I had_to deal with_videos_of_very high resolution.
What I_ended up doing
Well, left was option_number 2. Creating an AVPlayerItem for_a video when needed and feeding it_to the AVPlayer. The good thing_about this solution was the_memory consumption._By lazy creating the AVPlayerItems_and throwing them_away the_moment they were_not longer needed in could keep_memory consumption to_a minimum, which was very important_in_order to support_older_devices_with limited_RAM. The problem_with_this solution_was_that when going from one video_to_the next there a blank screen for_at quick moment while_the_next video was loaded_into memory. My idea of_fixing this was to put an_image behind_the AVPlayer_that would show when the player was buffering. I knew I_needed images that we exactly pixel_to pixel perfect with_the video,_so_I captured images_that_were exact_copies of the last and first frame_of the_videos. This solution worked great in_practice.
The problem with this_solution
I_had the issue though that the_position of the image inside the_UIImageView was not the same_as_the_position of the video inside_the AVPlayer if the video/image was_not its native_size or a module 4 scaling of_that._Said other words, I had a_problem_with how half pixels were handled_with_a_UIImageView and a AVPlayer. It_did not seem to be the_same way.
How I fixed it
I tried a lot of_stuff since I_my application was using the_videos_in_interactive way where shown in different sizes. I tried changed_the magnificationfilter_and minificationFilter of_AVPlayerLayer and CALayer to use the same algorithm but did_not really change anything. In the end_I ended up creating an iPad app that automatically could take_screenshots of the videos in all the sizes_I needed and then use the right_image when the video_was_scaled to a certain size. This gave_images_that_were_pixel perfect in_all of the_sizes I was_showing a_specific video. Not_a perfect_toolchain, but the_result_was perfect.
Final reflection