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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:47:29+00:00 2026-05-28T13:47:29+00:00

when playing a video inside a webview and looking at instruments – I see

  • 0

when playing a video inside a webview and looking at instruments – I see a high peak of memory usage when playing. (Around 23 MB in total)

As I leave the view (it is in a UINavigation view) all memory get cleared as it should. (using ARC)

IMPORTANT: I am loading the video from DISK and not loading it from server!

Question: Is there a way to reduce the memory when playing the video?

NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]; 
[NSURLCache setSharedURLCache:sharedCache]; 
//

NSURLRequest *request = [[NSURLRequest alloc] initWithURL: videoURL cachePolicy: NSURLRequestReloadIgnoringLocalAndRemoteCacheData timeoutInterval: 10.0];  
[webView loadRequest: request];  
[webView setOpaque:NO];

enter image description here

  • 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-28T13:47:30+00:00Added an answer on May 28, 2026 at 1:47 pm

    From your code it seems to me that you are trying to use an UIWebView as a video player, without displaying any other HTML content in it at the same time.

    Even though this is quite possible, it is, as you have observed, not particularly efficient – a UIWebView will load all of it’s content into memory since it was made for displaying web pages.

    A better solution would be to use Apple’s MediaPlayer framework, namely MPMoviePlayerController and/or MPMoviePlayerViewController.

    If you only need to playback fullscreen video, you should use MPMoviePlayerViewController. Using it is simple:

    MPMoviePlayerViewController *vc = [[MPMoviePlayerViewController alloc] initWithContentURL:videoURL];
    [self presentMoviePlayerViewControllerAnimated:vc];
    [vc release];
    

    This will present a modal view controller containing your clip.
    If you want to customize any part of it, you can use the moviePlayer property.

    If you would rather display video inside another view, you should look into MPMoviePlayerController.
    Using this class involves more boilerplate, but also gives you more control:

    MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:videoURL];
    [player prepareToPlay];
    player.view.frame = contentView.bounds; //The Player View's Frame must match the Parent View's
    // ...
    [player play];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm playing around with html5 video cause it's nice to have fallback for iphone/ipad.
I'd like to know about basic classes for playing video from webcam I'd also
Did anyone tried to customize the window in which the quicktime is playing video?
Background: I have a little video playing app with a UI inspired by the
So I have simple video tag on HTML 5 page playing OGG video. I
I am using flvplayer.swf player, it is playing the videos,but before playing the video
Hi all i've ran into another problems with VideoView . Then video is playing,
Playing around with Python - tkInter - Entry widget - when I use validatecommand
I am trying to play video inside a UIView , so my first step
I am using WPF mediaelement for playing video. What I need is to cyclically

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.