Advertisement
rotrevrep

Untitled

Apr 3rd, 2016
1,160
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public class Player : GLib.Object {
  2.     Gst.Element playbin;
  3.    
  4.     construct {
  5.         playbin = Gst.ElementFactory.make ("playbin", "bin");
  6.     }
  7.    
  8.     public void play() {
  9.         playbin.set_state (Gst.State.PLAYING);
  10.     }
  11.    
  12.     public void pause() {
  13.         playbin.set_state (Gst.State.PAUSED);
  14.     }
  15.    
  16.     public string uri {
  17.         owned get {
  18.             string u;
  19.             playbin.get ("uri", out u);
  20.             return u;
  21.         }
  22.         set {
  23.             playbin.set_state (Gst.State.NULL);
  24.             playbin["uri"] = value;
  25.         }
  26.     }
  27. }
Advertisement
RAW Paste Data Copied
Advertisement