Changeset - 958b309147b0
[Not reviewed]
default
0 3 0
drewp@bigasterisk.com - 14 years ago 2011-06-21 00:24:48
drewp@bigasterisk.com
display gst pipeline state on the web gui
Ignore-this: a4aed9827021e178701c6ea79be3e87a
3 files changed with 12 insertions and 1 deletions:
0 comments (0 inline, 0 general)
light9/ascoltami/index.html
Show inline comments
 
@@ -18,6 +18,7 @@
 
    <div>Time: <span id="currentTime"/></div>
 
    <div>Left: <span id="leftTime"/></div>
 
    <div>Until autostop: <span id="leftAutoStopTime"/></div>
 
    <div>States: <span id="states"/></div>
 
    <div class="timeRow">
 
      <div id="timeSlider"/>
 
    </div>
 
@@ -55,6 +56,7 @@
 
	    $("#leftTime").text((data.duration - data.t).toFixed(1));
 
	    $("#leftAutoStopTime").text(
 
		Math.max(0, data.duration - times.post - data.t).toFixed(1));
 
	    $("#states").text(JSON.stringify(data.state));
 
	    currentDuration = data.duration;
 
	    $("#timeSlider").slider({value: data.t,
 
				     max: data.duration});
light9/ascoltami/player.py
Show inline comments
 
@@ -118,6 +118,13 @@ class Player(object):
 
            return self.playbin.query_duration(gst.FORMAT_TIME)[0] / gst.SECOND
 
        except gst.QueryError:
 
            return 0
 

	
 
    def states(self):
 
        """json-friendly object describing the interesting states of
 
        the player nodes"""
 
        success, state, pending = self.playbin.get_state(timeout=0)
 
        return {"current": {"name":state.value_nick},
 
                "pending": {"name":state.value_nick}}
 
        
 
    def pause(self):
 
        self.pipeline.set_state(gst.STATE_PAUSED)
light9/ascoltami/webapp.py
Show inline comments
 
@@ -40,7 +40,9 @@ class timeResource(object):
 
            "started" : player.playStartTime,
 
            "duration" : player.duration(),
 
            "playing" : player.isPlaying(),
 
            "t" : player.currentTime()})
 
            "t" : player.currentTime(),
 
            "state" : player.states(),
 
            })
 

	
 
    def POST(self):
 
        """
0 comments (0 inline, 0 general)