Skip to content

Commit

Permalink
fix(video): add video native controls for wp8 platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Pietrzak committed Apr 9, 2015
1 parent 1e36afc commit 1302a23
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion js/utils/tap.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ ionic.tap = {
(ele.tagName == 'INPUT' && (/^(date|time|datetime-local|month|week)$/i).test(ele.type));
},

isVideo: function(ele) {
return !!ele &&
(ele.tagName == 'VIDEO');
},

isKeyboardElement: function(ele) {
if ( !ionic.Platform.isIOS() || ionic.Platform.isIPad() ) {
return ionic.tap.isTextInput(ele) && !ionic.tap.isDateInput(ele);
Expand Down Expand Up @@ -351,11 +356,13 @@ function tapMouseDown(e) {
console.log('mousedown', 'stop event');
e.stopPropagation();

if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !(/^(select|option)$/i).test(e.target.tagName)) {
if ((!ionic.tap.isTextInput(e.target) || tapLastTouchTarget !== e.target) && !(/^(select|option)$/i).test(e.target.tagName) && !ionic.tap.isVideo(e.target)) {
// If you preventDefault on a text input then you cannot move its text caret/cursor.
// Allow through only the text input default. However, without preventDefault on an
// input the 300ms delay can change focus on inputs after the keyboard shows up.
// The focusin event handles the chance of focus changing after the keyboard shows.
// Windows Phone - if you preventDefault on a video element then you cannot operate
// its native controls.
e.preventDefault();
}

Expand Down

0 comments on commit 1302a23

Please sign in to comment.