Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6eb970c5f9
Fetching contributors…

Cannot retrieve contributors at this time

50 lines (39 sloc) 1.503 kb
{% extends "jsdemo/base_demo.html" %}
{% block body %}
<video id="inPlaceVideo" autobuffer="" controls="" tabindex="0">
<source src="http://videos.mozilla.org/firefox/3.5/switch/switch.ogv"></source>
</video>
<div>
<a href="#" onclick="togglePlaying(); return false">toggle play</a>
</div>
<div id="insertedVideoContainer"></div>
<!-- Event log. -->
<fieldset class="goog-debug-panel">
<legend>Event Log</legend>
<div id="log" style="height: 300px; overflow-y: auto"></div>
</fieldset>
<div id="perf"></div>
<script type="text/javascript">
goog.debug.LogManager.getRoot().setLevel(goog.debug.Logger.Level.ALL);
var logger = goog.debug.Logger.getLogger('controls');
var logConsole = new goog.debug.DivConsole(goog.dom.$('log'));
logConsole.setCapturing(true);
var videoSource = new unisubs.player.Html5VideoSource(
'http://videos.mozilla.org/firefox/3.5/switch/switch.ogv',
unisubs.player.Html5VideoType.OGG);
var inPlacePlayer = videoSource.createPlayer();
var insertedPlayer = videoSource.createPlayer();
inPlacePlayer.decorate(document.getElementById('inPlaceVideo'));
var insertedContainer = new goog.ui.Component();
insertedContainer.decorate(document.getElementById('insertedVideoContainer'));
insertedContainer.addChild(insertedPlayer, true);
playing = false;
function togglePlaying() {
playing = !playing;
if (playing)
inPlacePlayer.play();
else
inPlacePlayer.pause();
}
</script>
{% endblock %}
Jump to Line
Something went wrong with that request. Please try again.