Skip to content

Commit 1302a23

Browse files
author
Tomasz Pietrzak
committed
fix(video): add video native controls for wp8 platform
1 parent 1e36afc commit 1302a23

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: js/utils/tap.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ ionic.tap = {
170170
(ele.tagName == 'INPUT' && (/^(date|time|datetime-local|month|week)$/i).test(ele.type));
171171
},
172172

173+
isVideo: function(ele) {
174+
return !!ele &&
175+
(ele.tagName == 'VIDEO');
176+
},
177+
173178
isKeyboardElement: function(ele) {
174179
if ( !ionic.Platform.isIOS() || ionic.Platform.isIPad() ) {
175180
return ionic.tap.isTextInput(ele) && !ionic.tap.isDateInput(ele);
@@ -351,11 +356,13 @@ function tapMouseDown(e) {
351356
console.log('mousedown', 'stop event');
352357
e.stopPropagation();
353358

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

0 commit comments

Comments
 (0)