-
Notifications
You must be signed in to change notification settings - Fork 237
Expand file tree
/
Copy pathforms4.html
More file actions
105 lines (93 loc) · 2.69 KB
/
forms4.html
File metadata and controls
105 lines (93 loc) · 2.69 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Video player on a page with form fields | Able Player Demos</title>
<link rel="stylesheet" href="demos.css" type="text/css">
<!-- Dependencies -->
<script src="https://code.jquery.com/jquery-3.7.1.slim.min.js" integrity="sha256-kmHvs0B+OpCW5GVHUNjv9rOmY0IvSIRcf7zGUDTDQM8=" crossorigin="anonymous"></script>
<!-- Able Player CSS -->
<link rel="stylesheet" href="../build/ableplayer.min.css" type="text/css"/>
<!-- Able Player JavaScript -->
<script src="../build/ableplayer.dist.js"></script>
<!-- CSS and JavaScript for this demo page -->
<style>
.form {
padding: 1rem;
background: #fff;
}
.form label, .form input {
display: block;
margin-bottom: 0.5em;
font-size: 1em;
}
.form label {
font-weight: bold;
}
.form #feedback {
font-weight: bold;
font-size: 1.1em;
color: black;
background-color: #FFC;
padding: 0.5em;
margin: 1em 0;
width: 20em;
text-align: center;
border: thin solid #340449;
display: none;
}
</style>
<script>
(function () {
var feedback, answer;
$(document).ready(function () {
$('#submit').on( 'click', function(event) {
event.preventDefault();
answer = $('#favplayer').val().toLowerCase();
if (answer.substring(0,4) == 'able') {
feedback = 'Correct!';
} else {
feedback = 'Wrong answer! Please try again.';
}
$('#feedback').text(feedback).show();
$('#favplayer').trigger('focus');
})
});
})();
</script>
</head>
<body>
<header>
<div class="title">Able Player Demos</div>
</header>
<nav>
<ul>
<li><a href="index.html">More demos</a></li>
<li><a href="https://ableplayer.github.io/ableplayer">Able Player Home</a></li>
</ul>
</nav>
<main>
<h1>Video player on a page with form fields</h1>
<form action="#" method="post">
<video id="video1" preload="auto" poster="../media/wwa.jpg" data-able-player playsinline>
<source type="video/mp4" src="../media/wwa.mp4"/>
<source type="video/webm" src="../media/wwa.webm"/>
<track kind="captions" src="../media/wwa_captions_en.vtt" srclang="en" label="English captions"/>
</video>
<h2>Form Fields</h2>
<p>When users are interacting with form fields,
their keystrokes should not be handled by the player.
If the player is contained within a form,
no buttons on the player should submit or otherwise affect the form.
</p>
<div class="form">
<div id="feedback" role="alert"></div>
<label for="favplayer">What's your favorite media player?</label>
<input type="text" id="favplayer">
<input type="submit" value="Submit" id="submit">
</div>
</form>
</main>
</body>
</html>