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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:25:27+00:00 2026-06-04T04:25:27+00:00

I have some questions related to AVPlayer which are: When we pause the AVPlayer

  • 0

I have some questions related to AVPlayer which are:

  1. When we pause the AVPlayer through [player pause] does the AVPlayer keep buffering the video from the network or does it just stop? I couldn’t get any info related to this in apple’s documentation. Also, is it possible to force the AVPlayer to keep buffering while in pause, so that if we have the paused video is in waiting for the first video to be ended then we wouldn’t find any gap in between the videos?

  2. On pausing the AVPlayer can we have any event on [player pause].

  3. Can we show still image on AVPlayer for some seconds?

Thanks

  • 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-06-04T04:25:28+00:00Added an answer on June 4, 2026 at 4:25 am

    1) AVPlayer will buffer the video in several cases, none cleary documented. I’d say you can expect buffering when you init the video, and when you replace the current item.
    You can observe currentItem.loadedTimeRanges to know what’s going on. That property will tell you which video time ranges has been loaded.

    Also, there is a few other currentItem properties that may help you: playbackLikelyToKeepUp, playbackBufferFull and playbackBufferEmpty.

    Achieving a perfect gapless playback is not easy.

    /* player is an instance of AVPlayer */
    [player addObserver:self 
             forKeyPath:@"currentItem.loadedTimeRanges" 
                options:NSKeyValueObservingOptionNew 
                context:kTimeRangesKVO];    
    

    In observeValueForKeyPath:ofObject:change:context::

    if (kTimeRangesKVO == context) {
       NSArray *timeRanges = (NSArray *)[change objectForKey:NSKeyValueChangeNewKey];
       if (timeRanges && [timeRanges count]) {
           CMTimeRange timerange = [[timeRanges objectAtIndex:0] CMTimeRangeValue];
           NSLog(@" . . . %.5f -> %.5f", CMTimeGetSeconds(timerange.start), CMTimeGetSeconds(CMTimeAdd(timerange.start, timerange.duration)));
       }
    }
    

    2) Just keep an eye on player.rate.

    [player addObserver:self 
             forKeyPath:@"rate" 
                options:NSKeyValueObservingOptionNew 
                context:kRateDidChangeKVO];
    

    Then in your observeValueForKeyPath:ofObject:change:context::

        if (kRateDidChangeKVO == context) {
            NSLog(@"Player playback rate changed: %.5f", player.rate);
            if (player.rate == 0.0) {
                NSLog(@" . . . PAUSED (or just started)");
            }
        }
    

    3) You can build a movie of a given length using a still image but it’s easier to use a regular UIImageView on top of the player. Hide/show it when needed.

    Sample project: feel free to play with the code I wrote to support my answer.

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

Sidebar

Related Questions

I have seen some related questions but none focusing on the specific problem I
I have some questions about using MySQLi queries, and related memory management. Suppose I
I have Used Dojo 1.0, but I have some version related questions: When will
I have some questions about importing data from Excel/CSV File into SQL Server. Let
I have some basic questions related to the conversion of Web Service (.asmx) into
I have some thread-related questions, assuming the following code. Please ignore the possible inefficiency
I have some questions related to RBAC (hirearchy model). Following are the scenarios Assume
I have two related questions. First, i have a some information such as: (732,
I have been through these related questions: How to convert numbers between hexadecimal and
I have seen some of the questions/answers related to this topic here, however still

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.