this.playbin = ElementFactory.make ("playbin2", null);
assert (this.playbin != null);
- this.playbin.eos += this.eos_cb;
+ // Bus handler
+ var bus = this.playbin.get_bus ();
+ bus.add_watch (this.bus_handler);
}
public static GstVideoWindow get_default () {
return video_window;
}
- private void eos_cb (Element playbin) {
- this.playback_state = "STOPPED";
- }
-
public bool seek (string time) {
debug ("Seeking to %s.", time);
return this.playbin.seek (1.0,
Gst.SeekType.NONE,
-1);
}
+
+ private bool bus_handler (Bus bus,
+ Message message) {
+ if (message.type == MessageType.EOS) {
+ debug ("EOS");
+ this.playback_state = "STOPPED";
+ }
+
+ return true;
+ }
}
// Helper class for converting between Gstreamer time units and string