|
18 | 18 |
|
19 | 19 | <meta name="viewport" content="width=device-width">
|
20 | 20 |
|
21 |
| -<script src="../polyfill-loader.js"></script> |
| 21 | +<script src="../components/web-animations-js/web-animations.min.js"></script> |
22 | 22 | <script src="../components/webcomponentsjs/webcomponents.js"></script>
|
23 | 23 | <link href="https://fonts.googleapis.com/css?family=RobotoDraft:300" rel="stylesheet" type="text/css">
|
24 | 24 | <link rel="import" href="../components/core-icon-button/core-icon-button.html"></link>
|
|
120 | 120 | var iterations = 3;
|
121 | 121 | Polymer('playback-demo', {
|
122 | 122 | error: '',
|
123 |
| - player: null, |
| 123 | + animation: null, |
124 | 124 | progress: 0,
|
125 | 125 | play: function() {
|
126 |
| - this.player.play(); |
| 126 | + this.animation.play(); |
127 | 127 | },
|
128 | 128 | pause: function() {
|
129 |
| - this.player.pause(); |
| 129 | + this.animation.pause(); |
130 | 130 | },
|
131 | 131 | reverse: function() {
|
132 |
| - this.player.reverse(); |
| 132 | + this.animation.reverse(); |
133 | 133 | },
|
134 | 134 | finish: function() {
|
135 |
| - this.player.finish(); |
| 135 | + this.animation.finish(); |
136 | 136 | },
|
137 | 137 | trackstart: function() {
|
138 |
| - this.player.pause(); |
| 138 | + this.animation.pause(); |
139 | 139 | },
|
140 | 140 | track: function(e) {
|
141 |
| - if (this.player.playState == 'paused') { |
142 |
| - var currentTime = this.player.currentTime += 3 * e.ddx; |
| 141 | + if (this.animation.playState == 'paused') { |
| 142 | + var currentTime = this.animation.currentTime += 3 * e.ddx; |
143 | 143 | currentTime = Math.min(duration * iterations, Math.max(0, currentTime));
|
144 |
| - this.player.currentTime = currentTime; |
| 144 | + this.animation.currentTime = currentTime; |
145 | 145 | this.progress = currentTime / (duration * iterations);
|
146 | 146 | }
|
147 | 147 | },
|
|
166 | 166 | iterations: Infinity,
|
167 | 167 | });
|
168 | 168 |
|
169 |
| - this.player = this.$.target.animate([ |
| 169 | + this.animation = this.$.target.animate([ |
170 | 170 | {transform: 'rotate(-45deg) scale(1)'},
|
171 | 171 | {transform: 'rotate(0) scale(2)'},
|
172 | 172 | {transform: 'rotate(45deg) scale(1)'},
|
|
178 | 178 | fill: 'both',
|
179 | 179 | });
|
180 | 180 |
|
181 |
| - if (!this.player.play) { |
| 181 | + if (!this.animation.play) { |
182 | 182 | this.error = "Sorry, your browser doesn't support playback control.";
|
183 | 183 | return;
|
184 | 184 | }
|
|
0 commit comments