title: Enabling Autoplay in Native iOS App
body: <p>I'm trying to enable autoplay for video in a native iOS app I'm working on. My company will be developing a full-fledged app this coming year, but I've been tasked with building out a rapid prototype. The point of this prototype is to give us a quick tool for playing with autoplay functionality that will be available through the <a href="http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html" rel="nofollow">UIWebView</a>.</p>
  
  <p>Just to paint a bit more of a picture. Our current website UX is best with autoplay functionality and a lot of our users are asking for this functionality on our mobile version of the site. At the moment we do serve up a slightly different site for mobile, but as you probably know Apple (due to data concerns) has disabled autoplay through JS/HTML5, etc. This is the reason we want to deliver an actual iOS app in the near future.</p>
  
  <p>So I'm brand new to Objective-C and iOS development, but after about a half-day of reading through the Apple developer docs I've managed to get as far as loading our site into a UIWebView. I'm then setting <code>mediaPlaybackRequiresUserAction = NO</code>. However, I'm not seeing the auto-playback functionality happening in the iOS Simulator.</p>
  
  <p>See more details here:</p>
  
  <blockquote>
    <p>mediaPlaybackRequiresUserAction A Boolean value that determines
    whether HTML5 videos can play automatically or require the user to
    start playing them.</p>
    
    <p>@property(nonatomic) BOOL mediaPlaybackRequiresUserAction Discussion
    The default value on both iPad and iPhone is YES.</p>
    
    <p>Availability Available in iOS 4.0 and later. Declared In UIWebView.h</p>
  </blockquote>
  
  <p>Here is the contents of my ViewController.h:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;    
  @interface myCompanyViewController : UIViewController
  @property (strong, nonatomic) IBOutlet UIWebView *webView;
  
  @end
  </code></pre>
  
  <p>And here is my ViewController.m:</p>
  
  <pre><code>#import "myCompanyViewController.h"
  
  @interface myCompanyViewController ()
  
  @end
  
  @implementation myCompanyViewController
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      // Do any additional setup after loading the view, typically from a nib.
      NSString *fullURL = @"http://www.mycompany.com";
      NSURL *url = [NSURL URLWithString:fullURL];
      NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
      [_webView loadRequest:requestObj];
      _webView.allowsInlineMediaPlayback = YES;
      _webView.mediaPlaybackRequiresUserAction = NO;
  }
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>
  
  <p>So what am I missing? I appreciate any help and advice you can give.</p>