Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

fabian9

macrumors 65816
Original poster
Nov 28, 2007
1,147
146
Bristol, UK
Guys,
Just saw this on youtube:
AirVideoEnabler

It lets you stream video content from any video application (including Safari) to AppleTV… looks like this might be the fix for one of the biggest complaints people have had about 4.2.1 so far!

The video description claims that the package is available in Cydia… I'm not currently jailbroken, so can't check.

Maybe somebody else could have a look for me?
 

Evgenyy

macrumors regular
Jun 23, 2010
193
0
I guess it might take time for BigBoss to approve it for their repo and set it up as paid app.
 

CharlesV

macrumors newbie
Jan 10, 2005
10
0
Plex iOS app gives me an "unable to read content error", Air Video just gives me a spinner then hits me back to the menu. Any luck with any other apps?
 

CharlesV

macrumors newbie
Jan 10, 2005
10
0
Current status with 4.2.1 redsn0wed ipad and stock 4.2 Apple TV:

Current status:

Plex - "An error occurred" message on Apple TV
Klexi - "An error occurred" message on Apple TV
Air Video - spinner on Apple TV, times out back to menu after a bit
Hulu Plus - no option due to custom video player
ABC Player - no option due to custom video player
SkyFire Browser (tested on the Daily Show website) - "An error occurred" message on Apple TV
Streamtome - Only audio, appears to use custom video player

So as of now, you can stream some videos from Safari but that's about all it provides.
 
Last edited:

Zone-MR

macrumors newbie
Jul 10, 2008
26
3
Hey all...

AirVideoEnabler is a pretty quick hack which enables the intrinsic AirVideo capability. Unfortunately, there seems to be a reason why this was not officially enabled by Apple - it's pretty unpolished, and your results may vary.

I've found many streams play OK, at least in Safari and a few other apps I've tested, however there are severe glitches in others. I'll keep updating AirVideoEnabler as and when I find ways to patch these, but at present YMMV.
 

CharlesV

macrumors newbie
Jan 10, 2005
10
0
Thanks, Zone-MR - not poopooing your work at all, just figured some people would want to know - I jailbreaked my iPad specifically for this (hoping to get rid of my mini and use a pad as a plex in-between). Not yet, it seems!
 

Evgenyy

macrumors regular
Jun 23, 2010
193
0
Current status with 4.2.1 redsn0wed ipad and stock 4.2 Apple TV:

Current status:

Plex - "An error occurred" message on Apple TV
Klexi - "An error occurred" message on Apple TV
Air Video - spinner on Apple TV, times out back to menu after a bit
Hulu Plus - no option due to custom video player
ABC Player - no option due to custom video player
SkyFire Browser (tested on the Daily Show website) - "An error occurred" message on Apple TV
Streamtome - Only audio, appears to use custom video player

So as of now, you can stream some videos from Safari but that's about all it provides.

Zone-MR, thanks a lot for getting it out there!

I can confirm the above post - all apps mentioned do not work. Air Video only works if you convert the file first. I think it uses a different instance of the video player for converted files. I noticed that where you have a bespoke menu (I.e. 30 second rewind button) the videos do not work with airvideo. All videos that have default player controls work. Also videos that show QuickTime logo before playing work fine.

To add to the list:
IMDB trailers work
Flixter trailers work
Yahoo entertainment app works
Dailymotion doesn't work due to custom player
 

LagaV

macrumors newbie
Oct 16, 2008
14
0
+GoodReader (which I ofter use for MP4 content that is not fully compliant with Apple specs --> not accepted by iTunes) works also fine.
 

fabian9

macrumors 65816
Original poster
Nov 28, 2007
1,147
146
Bristol, UK
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-gb) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5)

Safari doesn't work for me, only tried it with BBC iplayer though...

Keep up the good work zone-MR, and thanks for your work!
 

Zone-MR

macrumors newbie
Jul 10, 2008
26
3
The issue with iPlayer (and many other sites) is that the actual video stream is accessed through a url like http://blah/blah/blah/?token=2a4f4b9e3c...

The token seems to be generated once time a video is requested, and is only usable once.

So what actually happens is the iPhone tries to load the video (which succeeds), and then passes the URL to the Apple TV (which fails as each URL is only usable once). The Apple TV actually gets passed the stream URL for direct download + playback. I'll see if a patch can be implemented for the iPhone do do the downloading and proxy the data.
 

dhy8386

macrumors 6502a
Aug 13, 2008
826
21
I think it might be time to start a new thread of working apps / sites. I am happy to do it and maintain it unless Zone-MR you prefer to...

Ill start and we can always delete it or start a new one if you prefer...
 

econoar

macrumors regular
Apr 10, 2007
119
0
I think it might be time to start a new thread of working apps / sites. I am happy to do it and maintain it unless Zone-MR you prefer to...

Ill start and we can always delete it or start a new one if you prefer...

Great idea, please do.

Thanks for all your help Zone-MR
 

Zone-MR

macrumors newbie
Jul 10, 2008
26
3
Here are some more technical details covering AllPlay vs AirVideoEnabler, and future AirVideoEnabler developments for those who are interested... :D

I've now downloaded AllPlay and had a look at it, to see how its approach varies from mine. Just in case you're interested in some technical details, AllPlay hooks the following:

  • [UIMoviePlayerController setAllowsWirelessPlayback:]
  • [UIMoviePlayerController initWithPlayerSize:]
  • [MPMoviePlayerControllerNew allowsWirelessPlayback]
  • [MPMoviePlayerControllerNew setAllowsWirelessPlayback]
  • [MPMoviePlayerControllerNew init]
  • [MPMoviePlayerController allowsWirelessPlayback]
  • [MPMoviePlayerController setAllowsWirelessPlayback:]
  • [MPMoviePlayerController initWithContentURL:]
  • [MPMoviePlayerController init]
This is actually very similar to my original approach. However, after a little reverse engineering I realised that the above classes (UIMoviePlayerController , MPMoviePlayerController, MPMoviePlayerControllerNew) all form part of a class cluster alongside a few others AllPlay missed (MPPortraitVideoViewController, MPVideoOverlay, MPWildcatFullScreenVideoOverlay, MPTransportControls, and MPVideoViewController).

After a little digging, I realised that the core functionality is implemented in the class "MPVideoViewController", and all the classes mentioned above simply invoke this functionality. Therefore I narrowed down the function that needs to be hooked to exactly *one* :)

  • [MPVideoViewController allowsWirelessPlayback]
While I understand that at first glance, the AirPlay implementation may see more thorough, it is in general far more elegant to implement a hook at the core point where it matters, rather than trying to find and hook every airplay-related hook in the class cluster. More hooks aren't a good thing, and each hook increases the risk of stability problems as things change. For example, AllPlay currently causes all third-party apps linked against earlier frameworks to crash as soon as they try and play some video. Here's what happens when I try and fire up Crash Kart with AllPlay installed:

Sat Nov 27 13:19:07 unknown iFuse[4014] <Error>: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MPMoviePlayerControllerOld setAllowsWirelessPlayback:]: unrecognized selector sent to instance 0x26a750'

*** Call stack at first throw:
(
0 CoreFoundation 0x33ac0987 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x3347b49d objc_exception_throw + 24
2 CoreFoundation 0x33ac2133 -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x33a69aa9 ___forwarding___ + 508
4 CoreFoundation 0x33a69860 _CF_forwarding_prep_0 + 48
5 MediaPlayer 0x31e63411 -[MPMoviePlayerController setAllowsWirelessPlayback:] + 32

The class cluster internally instantiates a MPMoviePlayerControllerOld object instead of MPMoviePlayerController, which lacks the setAllowsWirelessPlayback method, and the whole app crashes. This affects a lot of applications, and the average user may not realise why many of their apps are suddenly crashing.

One of the issues I've noticed with AirPlay is that it will send the media URL to the Apple TV, and not the stream itsself. This is a sensible implementation as it removes the need for the iOS to be powered on and reliably networked during playback of videos on the TV, however it introduces problems for some online services like BBC iPlayer as these generate a URL containing a one-time token - so the stream stops working when switching between the iPhone and the Apple TV as the URL is only valid once. In a future AirVideoEnabler update, I plan to add detection of this scenario, and proxying of the video stream via the device.
 

fabian9

macrumors 65816
Original poster
Nov 28, 2007
1,147
146
Bristol, UK
Wirelessly posted (Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-gb) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5)

So in other words, pretty much any compatible content would play if there were a way to simply send a URL to the apple tv?
 

csiplon

macrumors newbie
Sep 6, 2008
5
0
Can we use this to airplay videos from ip4's camera roll? Zone MR can you confirm? Thanks!
 

Evgenyy

macrumors regular
Jun 23, 2010
193
0
Here are some more technical details covering AllPlay vs AirVideoEnabler, and future AirVideoEnabler developments for those who are interested... :D

I've now downloaded AllPlay and had a look at it, to see how its approach varies from mine. Just in case you're interested in some technical details, AllPlay hooks the following:

  • [UIMoviePlayerController setAllowsWirelessPlayback:]
  • [UIMoviePlayerController initWithPlayerSize:]
  • [MPMoviePlayerControllerNew allowsWirelessPlayback]
  • [MPMoviePlayerControllerNew setAllowsWirelessPlayback]
  • [MPMoviePlayerControllerNew init]
  • [MPMoviePlayerController allowsWirelessPlayback]
  • [MPMoviePlayerController setAllowsWirelessPlayback:]
  • [MPMoviePlayerController initWithContentURL:]
  • [MPMoviePlayerController init]
This is actually very similar to my original approach. However, after a little reverse engineering I realised that the above classes (UIMoviePlayerController , MPMoviePlayerController, MPMoviePlayerControllerNew) all form part of a class cluster alongside a few others AllPlay missed (MPPortraitVideoViewController, MPVideoOverlay, MPWildcatFullScreenVideoOverlay, MPTransportControls, and MPVideoViewController).

After a little digging, I realised that the core functionality is implemented in the class "MPVideoViewController", and all the classes mentioned above simply invoke this functionality. Therefore I narrowed down the function that needs to be hooked to exactly *one* :)

  • [MPVideoViewController allowsWirelessPlayback]
While I understand that at first glance, the AirPlay implementation may see more thorough, it is in general far more elegant to implement a hook at the core point where it matters, rather than trying to find and hook every airplay-related hook in the class cluster. More hooks aren't a good thing, and each hook increases the risk of stability problems as things change. For example, AllPlay currently causes all third-party apps linked against earlier frameworks to crash as soon as they try and play some video. Here's what happens when I try and fire up Crash Kart with AllPlay installed:



The class cluster internally instantiates a MPMoviePlayerControllerOld object instead of MPMoviePlayerController, which lacks the setAllowsWirelessPlayback method, and the whole app crashes. This affects a lot of applications, and the average user may not realise why many of their apps are suddenly crashing.

One of the issues I've noticed with AirPlay is that it will send the media URL to the Apple TV, and not the stream itsself. This is a sensible implementation as it removes the need for the iOS to be powered on and reliably networked during playback of videos on the TV, however it introduces problems for some online services like BBC iPlayer as these generate a URL containing a one-time token - so the stream stops working when switching between the iPhone and the Apple TV as the URL is only valid once. In a future AirVideoEnabler update, I plan to add detection of this scenario, and proxying of the video stream via the device.

Seems that you nailed it with the URL tokens and the need for proxying the video stream. This could probably solve the issue that we are having with Plex App too. Currently switching Plex video to Apple TV generates the following error:
"[0xb0396000] ERROR - Client fe80::5a55:caff:fe1b:8ddb%en0 didn't have required security headers."

Apple TV cannot send security headers to Plex Media Server and the connection gets refused. If there was a way to have video stream proxied via device then I think it would be playing fine on ATV.
 

JohnDoe98

macrumors 68020
May 1, 2009
2,488
99
Confirmed working on iPad:

Hockeystreams.com in Safari
Zumocast

Wonderful app, thanks for it!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.