[gnome-getting-started-docs/video-controls] That focus thing wasn't really working



commit 91e880a13f3b5ed55e03c90b49b85ad42fd87647
Author: Jakub Steiner <jimmac gmail com>
Date:   Thu Nov 1 19:56:44 2012 +0100

    That focus thing wasn't really working
    
    - just play/pause when video is focused on Enter
    - show the overlay controls when fcused

 .../acornmediaplayer/jquery.acornmediaplayer.js    |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/getting-started/C/custom-video-controls/acornmediaplayer/jquery.acornmediaplayer.js b/getting-started/C/custom-video-controls/acornmediaplayer/jquery.acornmediaplayer.js
index 9268c65..7a577c9 100644
--- a/getting-started/C/custom-video-controls/acornmediaplayer/jquery.acornmediaplayer.js
+++ b/getting-started/C/custom-video-controls/acornmediaplayer/jquery.acornmediaplayer.js
@@ -925,12 +925,15 @@
 					initCaption();					
 				});
 			
-			  //allow focusing controls with tab
-			  acorn.$controls.find('.acorn-play-button').focus(function () {
-			    acorn.$controls.css({
-			      'visibility': 'visible',
-			      'opacity': '0.7'
-			      });
+			  //play back on enter when focused
+			  acorn.$container.find('video').keypress(function (e) {
+			    console.log($(this),e.keyCode); /* 13 enter, 39 right, 37 left, 122 F11 */
+			    if (e.keyCode == 13) {
+			      playMedia();
+			    }
+			    if (e.keyCode == 122) {
+			      goFullscreen();
+			    }
 			  });
 			
 				// trigger update seek manualy for the first time, for iOS support



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]