Re: Web Kit - playing HTML5 video in a separate window
Re: Web Kit - playing HTML5 video in a separate window
- Subject: Re: Web Kit - playing HTML5 video in a separate window
- From: Nick <email@hidden>
- Date: Sat, 10 Dec 2011 07:23:58 +0200
Jens,
Let me explain again: I'd like to have Mac OS Web Kit behave like iOS
Web Kit behaves.
What iOS's Safari does, when you click "play" on the video component
(HTML 5 <video>) on the web page - it opens a fullscreen "window" with
playback controls and starts playing it there. If you connect TV to
your iPhone 4 - you'll get the full screen video playback on your TV
(with control buttons - play pause stop and track control - still on
the iPhone screen).
iPhone simulator can 'simulate' this TV out screen with a window,
where HTML5 is played "full window".
Now, if you spoof an iPhone user agent for Mac OS Safari (using Web
Kit's delegate, for example, or using real Safari browser - in a
developer menu you can make Safari send its User-Agent HTTP header
field as "iPhone 4 device") - you won't get any of this. HTML5 videos
won't be played full screen by default. Because Mac OS Safari treats
<video> tag differently and renders it differently. There's no TV Out
option, of course, to direct the video playback to an external device,
or an external window.
This is what I'd like to have - to be able to play video in a
window/fullscreen, preferably having my own movie controls (similar to
iPhone's ones).
If you go to m.youtube.com from your iPhone (or iPhone simulator)
you'll see what I just described - a nice iphone-like interface, and
player that plays everything fullscreen. Then, if you go to
m.youtube.com from the Desktop Safari (and set its User-Agent to
pretend to be "iPhone Safari"), you won't even be able to play the
videos - you click on them, hear the sound, but don't see the movie
being played.
2011/12/10 Jens Alfke <email@hidden>:
>
> On Dec 6, 2011, at 1:43 PM, Nick wrote:
>
> Is it possible to make a desktop WebKit play HTML5 videos like an
> iPhone Simulator does it, when the "TV Out" window is opened?
>
>
> Sure; WebKit can display anything Safari can.
>
> How does a mobile Safari manage to play the video in a separate
> window? (a screenshot: http://rghost.net/33556141/image.png).
>
>
> There’s a delegate message you get when a WebView wants to open a new
> window. You implement that, open a window with a WebView in it, and tell it
> about the new view. I can’t remember exactly where this delegate message is,
> because there are so many delegate interfaces in WebKit, but it shouldn’t be
> hard to find.
>
> —Jens
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden