Skip to content
Browse files

added support for fullscreen video in WebKit (Safari HEAD, that is)

  • Loading branch information...
1 parent 70d2f19 commit 3e6b78b28528ba5d1c060cbe037ce870a207a832 @rsms committed
Showing with 12 additions and 3 deletions.
  1. +8 −2 index.html
  2. +4 −1 jquery.hvideo.js
View
10 index.html
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<title>HTML5 video player</title>
- <script src="jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="jquery.hvideo.js" type="text/javascript" charset="utf-8"></script>
<script src="hvideo-debug.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="hvideo.css" type="text/css" media="screen" title="HTML5 video base style" charset="utf-8">
@@ -39,7 +39,13 @@
<button class="zoom" title="Zoom in/out"></button>
</extended>
</controls>
- <video width="640" height="360" src="http://www.dailymotion.com/cdn/OGG-320x240/video/x99gp5_transformers640_creation?auth=1260090977-d20467f8e3d48ca04aada2e69ff9e545" autobuffer>
+ <video width="640" height="360"
+ poster="http://hunch.se/tmp/Spotify_-_the_story.jpg"
+ autobuffer>
+ <source src="http://hunch.se/tmp/Spotify_-_the_story_720p.mp4"
+ type="video/mp4">
+ <source src="http://hunch.se/tmp/Spotify_-_the_story_720p.ogv"
+ type="video/ogg">
<div class="fallback">
You must have an HTML5 capable browser.
</div>
View
5 jquery.hvideo.js
@@ -58,6 +58,9 @@ jQuery.fn.hvideo = function(options){
hvideo.video.pause();
}
hvideo.toggleZoomed = function(ev){
+ if (hvideo.video.webkitEnterFullScreen !== undefined) {
+ return hvideo.video.webkitEnterFullScreen();
+ }
if (!hvideo.zoomed) {
// todo: in zoomed mode, hide mouse after N time of
// inactivity (track movement when playing).
@@ -327,7 +330,7 @@ jQuery.fn.hvideo = function(options){
}).bind('ended', function(ev){
this.pause();
}).bind('error', function(ev){
- console.log('error! (load error)');
+ console.log('error -- failed to load video', ev);
}).bind('loadedmetadata', function(ev){
if (hvideo.autoresize) {
vq.width(hvideo.video.videoWidth).height(hvideo.video.videoHeight);

0 comments on commit 3e6b78b

Please sign in to comment.
Something went wrong with that request. Please try again.