2010-12-28, 19:38
Niels Leenheer Wrote:I've been playing around a bit and found that playing videos from iTunes to XBMC using Airplay might be possible with some modifications.
Currently iTunes does not list XBMC as a suitable Airplay target for videos, because it requires a couple of extra DNS txt records in the Bonjour configuration. However when I manually added the following txt records it did showed up and worked perfectly:
The contents of the deviceid does not seem to matter, but the original txt record broadcast by my AppleTV seems to be related to the mac address:Code:deviceid=00:00:00:00:00:00
features=0x7
model=AppleTV2,1
Please note that you need to play a video in iTunes and choose the AirPlay target on the video controls. The general iTunes AirPlay control does not list XBMC. Playing music is also not supported, because that uses the older AirTunes protocol, which is completely separate from the AirPlay protocol.Code:MAC address: xxxx:xx55:CAxx:xx06:BD9E
deviceid: xx:55:CA:06:BD:9E
I've also got AirPlayer showing up in iTunes as an Airplay target
To get this working, I modified airplayer.py as follows to write the TXT records (thanks for the tip on this)
import settings
import utils
import signal
import pybonjour
.
.
.
.
def _register_bonjour(self):
hostname = gethostname()
hostname = utils.clean_hostname(hostname)
txtRecord=pybonjour.TXTRecord()
txtRecord['deviceid'] = '00:00:00:00:00:00'
txtRecord['features'] = '0x7'
txtRecord['model'] = 'AppleTV2,1'
thread.start_new_thread(bonjour.register_service, (hostname, "_airplay._tcp", self.port, txtRecord,))
I also modified bonjour.py as follows
def register_service(name, regtype, port, txtRecord):
def register_callback(sdRef, flags, errorCode, name, regtype, domain):
if errorCode == pybonjour.kDNSServiceErr_NoError:
logger.info('Registered bonjour service %s', name)
service = pybonjour.DNSServiceRegister(name = name,
regtype = regtype,
port = port,
callBack = register_callback,
txtRecord = txtRecord)
Now after AirPlayer is started I can see the the new airplay target in the airplay menu in iTunes
I seem to be unable to select the AirPlayer target from the iTunes airplay menu for some reason.
The option is there but not selectable
Perhaps there are other TXT records required in the bonjour broadcast...
I'm running this from Windows XP SP3
I can get airplay to play video via XBMC (Dharma build, running on Windows XP SP3) from an iPhone (with ios 4.2) without any issues