Menu

[r2492]: / osmf / trunk / player / StrobeMediaPlayback / html-template / hello-world-jquery-plugin.html  Maximize  Restore  History

Download this file

141 lines (124 with data), 4.9 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Flash/Strobe Media Playback</title>
<style type="text/css">
body {
font: 12px Arial, sans-serif;
background-color: #000000;
color: #FFFFFF;
height: 100%;
width: 100%;
margin: 0;
overflow: hidden;
}
</style>
<script type="text/javascript" src="lib/jquery/jquery-1.4.2.js">
</script>
<script type="text/javascript" src="jquery.strobemediaplayback.js">
</script>
<script type="text/javascript" src="lib/swfobject.js">
</script>
<link type="text/css" href="jquery.strobemediaplayback.css" rel="stylesheet" />
<script type="text/javascript">
$(function(){
$.fn.adaptiveexperienceconfigurator.rules.push(
// is Firefox
function(context, options){
context.isFirefox = context.userAgent.match(/Firefox/i) != null;
if (context.isFirefox && options.useHTML5) {
context.setOption(options, "src", "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg");
}
else {
context.setOption(options, "src", "http://osmf.org/dev/videos/cathy2_HD.mp4");
}
});
var options={
id: "smpVideo",
src: "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4",
//src: "http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg",
//src: "http://localhost/Psychology 02 - Responsive Brain.mpg",
width: 480,
height: 362,
poster: "images/poster.png",
favorFlashOverHtml5Video: true
};
// Using HTMLVideoElement directly
//var $video = $(".videoElement");
// Using StrobeMediaPlayback
var $video = $(".strobemediaplayback").strobemediaplayback(options);
$video.bind("durationchange", onDurationChange);
$video.bind("timeupdate", onTimeUpdate);
$("#play-pause").bind("click", $video, onPlayPauseClick);
$("#playlist a").bind("click", $video, onPlaylistItemClick);
});
function onDurationChange(event)
{
$("#duration").html(this.duration);
}
function onTimeUpdate(event)
{
$("#currentTime").html(this.currentTime);
}
function onPlayPauseClick(event)
{
var video = event.data[0];
if (video.paused)
{
video.play();
}
else
{
video.pause();
}
}
function onPlaylistItemClick(event)
{
event.preventDefault();
var video = event.data[0];
video.src = this.href;
video.load();
video.play();
}
</script>
</head>
<body>
<!--<video class="video-element"
src="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg"
width="480"
height="362"
poster="images/poster.png">Alternative content</video> -->
<div class="strobemediaplayback"
id="strobemediaplayback"
data-smp-src="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4"
data-smp-width="480"
data-smp-height="362"
data-smp-poster="images/poster.png"
data-smp-favorFlashOverHtml5Video="false">Alternative content</div>
<div>
<div>
<span id="currentTime" /> ... </span> : <span id="duration" /> ... </span>
</div>
<a href="#" id="play-pause">Play/Pause</div>
</div>
<div id="playlist">
<a href="http://osmf.org/dev/videos/cathy1_SD.mp4">OSMF SD</a>
<br/>
<a href="http://osmf.org/dev/videos/cathy1_HD.mp4">OSMF HD</a>
<br/>
<a href="http://osmf.org/dev/videos/cathy2_SD.mp4">SMP SD</a>
<br/>
<a href="http://osmf.org/dev/videos/cathy2_HD.mp4">SMP HD</a>
<br/>
<a href="http://media.w3.org/2010/05/sintel/trailer.mp4">http://media.w3.org/2010/05/sintel/trailer.mp4</a>
<br/>
<a href="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4">http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.mp4</a>
<h3>OGG files, for Firefox HTML5 only</h3>
<a href="http://media.w3.org/2010/05/sintel/trailer.ogv">http://media.w3.org/2010/05/sintel/trailer.ogv</a>
<br/>
<a href="http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg">http://players.edgesuite.net/videos/big_buck_bunny/bbb_448x252.ogg</a>
<br/>
</div>
</body>
</html>