title: How can I start QuickTime and have it start playing a url?
body: <p>I'm using MonoMac, but I understand cocoa and objc well enough that if you can answer me in those languages, please do.</p>
  
  <p>I have a url from my web server which returns an mp4. I'd like my MonoMac application to launch QuickTime and start playing that url.</p>
  
  <p>I tried these methods:</p>
  
  <pre><code>Process.Start("/Applications/QuickTime Player.app/Contents/MacOS/QuickTime Player", url);
  </code></pre>
  
  <p>but when the url is something like <a href="http://webhost/1/blah.mp4" rel="nofollow">http://webhost/1/blah.mp4</a>, quicktime says "The document blah.mp4 could not be opened. The file doesn't exist. I know the file exists and everything is correct. If I use this method:</p>
  
  <pre><code>var cfurl = MonoMac.CoreFoundataion.CFUrl.FromUrlString(url, null);
  LSOpenCFURLRef(cfurl.Handle, (IntPtr)null);
  </code></pre>
  
  <p>The stream is opened in Safari and the QuickTime plugin starts playing it.</p>
  
  <p>I've also tried NSWorkspace OpenUrls and OpenFile</p>
  
  <pre><code>NSWorkspace.SharedWorkspace.OpenUrls(new[]{NSUrl.FromString(url)},
                                       @"com.apple.quicktimeplayer", 
                                       NSWorkspaceLaunchOptions.Async,
                                       new NSAppleEventDescriptor(),
                                       new[]{""});
  </code></pre>
  
  <p>but this launches in safari</p>
  
  <pre><code> NSWorkspace.SharedWorkspace.OpenFile(url, "QuickTimePlayer");
  </code></pre>
  
  <p>but this does nothing.</p>
  
  <p>So I try NSTask</p>
  
  <pre><code>MonoMac.Foundation.NSTask.LaunchFromPath("/Applications/QuickTime Player.app/Contents/MacOS/QuickTime Player",
                                           new string[] {url});
  </code></pre>
  
  <p>But this gives the same "... could not be found..." as my very first attempt above.</p>
  
  <p>Finally, if I start QuickTime Player and use open URL and paste the url into the textbox and click Open, the stream plays without error.</p>
  
  <p>How can my cocoa app send a URL to QuickTime Player?</p>