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 6744299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:04:02+00:00 2026-05-26T12:04:02+00:00

So I set up an ATPagingView(ScrollView)( https://github.com/andreyvit/SoloComponents-iOS/tree/master/ATPagingView ) with a custom PageView for each

  • 0

So I set up an ATPagingView(ScrollView)(https://github.com/andreyvit/SoloComponents-iOS/tree/master/ATPagingView) with a custom PageView for each page. The page view is loaded with a AVPlayerLayer which was/is loaded with a AVPlayer(was because as part of trying to fix this I have tried using an AVQueuePlayer). Now the ATPagingView had page recycling built in so that I shouldn’t be loading all 15 video at once(have it set to 3) and I added a reload function to the PageView that basically loads the video for the new page index without re-initing everything, but before I just re-inited everything and it still didn’t work. I’m pretty positive it’s a memory thing with the avplayers, but the profiler shows no leaks and a constant memory footprint. I now that the ATPagingView is sending the right index and everything because I also have labels on the PageViews that are correct.

I have tried this: Playing many different videos on iphone using AVPlayer with no luck. As well as trying to use AVQueuePlayers to handle the reloading instead of replaceCurrentItemWithPlayerItem:. Again no luck.

Here is roughly the init code now:

    NSURL* m =[[NSBundle mainBundle] URLForResource:page.video withExtension:page.videoExt];


        self.player = [AVQueuePlayer queuePlayerWithItems:[NSArray arrayWithObject:[AVPlayerItem playerItemWithURL:m]]];
        self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];

        self.playerLayer.frame = self.frame;
        [img.layer addSublayer: self.playerLayer];
        self.player.actionAtItemEnd = AVPlayerActionAtItemEndNone; 

        [[NSNotificationCenter defaultCenter] addObserver:self
                                                 selector:@selector(playerItemDidReachEnd:)
                                                     name:AVPlayerItemDidPlayToEndTimeNotification
                                                   object:[self.player currentItem]];
        [self.player play];

And the reload code looks something like this:

    [[NSNotificationCenter defaultCenter] removeObserver:self name:AVPlayerItemDidPlayToEndTimeNotification object:[self.player currentItem]];
[self.player removeAllItems];

        NSURL* m =[[NSBundle mainBundle] URLForResource:page.video withExtension:page.videoExt];

        //AVPlayer version
        url = m;
        AVAsset *newAsset = [AVURLAsset URLAssetWithURL:url options:nil];
        AVPlayerItem *newPlayerItem = [AVPlayerItem playerItemWithAsset:newAsset];
        [self.player insertItem:newPlayerItem afterItem:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
                                         selector:@selector(playerItemDidReachEnd:)
                                             name:AVPlayerItemDidPlayToEndTimeNotification
                                           object:newPlayerItem];
        [self.player play];

Like I said, it’s not everytime it reloads, but if I go into the ATPagingView and then exit it back to the menu and then go back in that’s when it’ll start happening.

Any ideas?

  • 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-05-26T12:04:02+00:00Added an answer on May 26, 2026 at 12:04 pm

    I changed the loader to not pre-cache the views and it fixed it! Released on the market now^^

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

Sidebar

Related Questions

I set up a website to use SqlMembershipProvider as written on this page .
I set up 404 handler page in web.config, but it works ONLY when extension
Set oXMLHttp=Server.CreateObject(MSXML2.XMLHTTP) On Error Resume Next oXMLHttp.open GET, http://xxxxxx.com,False oXMLHttp.setRequestHeader Content-Type, application/x-www-form-urlencoded oXMLHttp.send() x
Set Success page redirection in google checkout ? i have already set callback URL
i set up a simple personal page that shows some personal information of mine.
//Set default values $('#name').val('First Last'); $('#email').val('you@email.com'); $('#subject').val('Subject'); $('#message').val('Message'); //Change style when user types $('#name,#email,#subject,#message').keypress(function()
:set ic ignores the case. How do you unset this?
Set<Type> union = new HashSet<Type>(s1); union.addAll(s2); AND Set <Type> union = new HashSet<Type>(); union.addAll(s1);
Set content of table ... ViewState[Table1] = Table1; // When remove this line, table
I set a passphrase when creating a new SSH key on my laptop. But,

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.