Voilà un diff de toutes les modifs dont on a parlé :
Il manque peut-être le import gobject que tu as rajouté quelque part... je l'avais supprimé car je le pensais remplacé par from gi.repository import GObject, Peas, Totem
Edit: peut être que j'ai oublié de modifier quelques gobject en GObject dans airplay.py.
diff -up airplay/airplay.plugin.totem3 airplay/airplay.plugin
--- airplay/airplay.plugin.totem3 2011-10-14 10:21:42.376805661 +0200
+++ airplay/airplay.plugin 2011-10-12 19:53:41.891880372 +0200
@@ -0,0 +1,10 @@
+[Plugin]
+Loader=python
+Module=airplay
+IAge=1
+Builtin=false
+Name=AirPlay Support 1.0.2
+Description=Playback of videos using Apple AirPlay. iOS 4.2.1 or later required.
+Authors=Martin S.
+Copyright=Copyright © 2010-2011 Martin S.
+Website=http://www.libimobiledevice.org/
diff -up airplay/airplay.py.totem3 airplay/airplay.py
--- airplay/airplay.py.totem3 2011-04-07 15:23:37.000000000 +0200
+++ airplay/airplay.py 2011-10-14 10:48:51.822253547 +0200
@@ -20,23 +20,26 @@
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
-import gobject
-import totem
+from gi.repository import GObject, Peas, Totem
+from AirPlayService import AirPlayService
import platform
import time
-from AirPlayService import AirPlayService
-class AirPlayPlugin (totem.Plugin):
+class AirPlayPlugin (GObject.Object, Peas.Activatable):
+ __gtype_name__ = 'AirPlayPlugin'
+
+ object = GObject.property (type = GObject.Object)
+
def __init__ (self):
- totem.Plugin.__init__ (self)
- self.totem = None
+ GObject.Object.__init__ (self)
+ self._totem = None
- def activate (self, totem_object):
- self.service = AirPlayTotemPlayer(totem=totem_object,name="Totem on %s" % (platform.node()))
+ def do_activate (self):
+ self._totem = self.object
+ self.service = AirPlayTotemPlayer(totem=self._totem,name="Totem on %s" % (platform.node()))
- def deactivate (self, totem_object):
+ def do_deactivate (self):
self.service.__del__()
-
class AirPlayTotemPlayer(AirPlayService):
def __init__(self, totem, name=None, host="0.0.0.0", port=22555):
self.location = None
@@ -60,7 +63,7 @@ class AirPlayTotemPlayer(AirPlayService)
# this must seek to a certain time
def set_scrub(self, position):
if self.totem.is_seekable():
- gobject.idle_add(self.totem.action_seek_time, int(float(position) * 1000), False)
+ GObject.idle_add(self.totem.action_seek_time, int(float(position) * 1000), False)
# this only sets the location and start position, it does not yet start to play
def play(self, location, position):
@@ -69,7 +72,7 @@ class AirPlayTotemPlayer(AirPlayService)
# stop the playback completely
def stop(self, info):
- gobject.idle_add(self.totem.action_stop)
+ GObject.idle_add(self.totem.action_stop)
# reverse HTTP to PTTH
def reverse(self, info):
@@ -81,7 +84,7 @@ class AirPlayTotemPlayer(AirPlayService)
if self.location is not None:
timeout = 5
# start playback and loading of media
- gobject.idle_add(self.totem.add_to_playlist_and_play, self.location[0], "AirPlay Video", False)
+ GObject.idle_add(self.totem.add_to_playlist_and_play, self.location[0], "AirPlay Video", False)
# wait until stream-length is loaded and is not zero
duration = 0
while (int(duration) == 0 and timeout > 0):
@@ -96,10 +99,10 @@ class AirPlayTotemPlayer(AirPlayService)
self.set_scrub(targetoffset)
if (not self.totem.is_playing()):
- gobject.idle_add(self.totem.action_play)
+ GObject.idle_add(self.totem.action_play)
del self.location
self.location = None
else:
- gobject.idle_add(self.totem.action_pause)
+ GObject.idle_add(self.totem.action_pause)
diff -up airplay/AirPlayService.py.totem3 airplay/AirPlayService.py
--- airplay/AirPlayService.py.totem3 2011-04-07 15:23:37.000000000 +0200
+++ airplay/AirPlayService.py 2011-10-14 10:48:36.972358325 +0200
@@ -56,7 +56,10 @@ class BaseAirPlayRequest(object):
if (self.uri.find('?')):
url = urlparse(self.uri)
if (url[4] is not ""):
- self.params = dict([part.split('=') for part in url[4].split('&')])
+ try:
+ self.params = dict([part.split('=') for part in url[4].split('&')])
+ except:
+ self.params = url[4].split('&')
self.uri = url[2]
# parse message body
@@ -191,6 +194,8 @@ class AirPlayProtocolHandler(asyncore.di
</plist>'
content = content % (self.service.deviceid, self.service.features, self.service.model)
answer = self.create_request(200, "Content-Type: text/x-apple-plist+xml", content)
+ elif (request.uri.find('/setProperty')>-1):
+ answer = self.create_request()
else:
print "ERROR: AirPlay - Unable to handle request \"%s\"" % (request.uri)
answer = self.create_request(404)
diff -up airplay/airplay.totem-plugin.totem3 airplay/airplay.totem-plugin
--- airplay/airplay.totem-plugin.totem3 2011-04-07 15:23:37.000000000 +0200
+++ airplay/airplay.totem-plugin 2011-10-14 10:31:12.492784234 +0200
@@ -1,10 +0,0 @@
-[Totem Plugin]
-Loader=python
-Module=airplay
-IAge=1
-Builtin=false
-Name=AirPlay Support 1.0.2
-Description=Playback of videos using Apple AirPlay. iOS 4.2.1 or later required.
-Authors=Martin S.
-Copyright=Copyright © 2010-2011 Martin S.
-Website=http://www.libimobiledevice.org/
C'est mieux ainsi.