|
1 | 1 | import '@polymer/iron-icon/iron-icon';
|
2 | 2 | import { html, PolymerElement } from '@polymer/polymer/polymer-element';
|
3 | 3 | import 'player-icons/player-icons';
|
| 4 | +import 'ua-parser-js'; |
4 | 5 | import playerStyles from './player-styles';
|
5 | 6 |
|
6 | 7 | /**
|
@@ -102,21 +103,23 @@ class MP4VideoPlayer extends PolymerElement {
|
102 | 103 | </div>
|
103 | 104 | </div>
|
104 | 105 | <div class="right">
|
105 |
| - <div id="volume_icons" class="control-icons" tabindex="0" on-click="_toggleMute"> |
106 |
| - <template is="dom-if" if={{muted}}> |
107 |
| - <iron-icon icon="player-icons:volume-off"></iron-icon> |
108 |
| - </template> |
109 |
| - <template is="dom-if" if={{!muted}}> |
110 |
| - <iron-icon icon="player-icons:volume-up"></iron-icon> |
111 |
| - </template> |
112 |
| - <span class="tooltip">[[_tooltipCaptions.volumeButton]]</span> |
113 |
| - </div> |
114 |
| - <div id="volume_track" class="track volume" on-mousedown="_handleDown" on-touchstart="_handleDown"> |
115 |
| - <div id="volume_track_slider" class="slider volume"> |
116 |
| - <div id="volume_track_thumb" class="thumb volume"></div> |
117 |
| - <div id="volume_track_fill" class="fill volume"></div> |
| 106 | + <template is="dom-if" if={{!isIOSDevice}}> |
| 107 | + <div id="volume_icons" class="control-icons" tabindex="0" on-click="_toggleMute"> |
| 108 | + <template is="dom-if" if={{muted}}> |
| 109 | + <iron-icon icon="player-icons:volume-off"></iron-icon> |
| 110 | + </template> |
| 111 | + <template is="dom-if" if={{!muted}}> |
| 112 | + <iron-icon icon="player-icons:volume-up"></iron-icon> |
| 113 | + </template> |
| 114 | + <span class="tooltip">[[_tooltipCaptions.volumeButton]]</span> |
118 | 115 | </div>
|
119 |
| - </div> |
| 116 | + <div id="volume_track" class="track volume" on-mousedown="_handleDown" on-touchstart="_handleDown"> |
| 117 | + <div id="volume_track_slider" class="slider volume"> |
| 118 | + <div id="volume_track_thumb" class="thumb volume"></div> |
| 119 | + <div id="volume_track_fill" class="fill volume"></div> |
| 120 | + </div> |
| 121 | + </div> |
| 122 | + </template> |
120 | 123 | <div id="fullscreen_icons" class="control-icons" on-click="_toggleFullscreen">
|
121 | 124 | <template is="dom-if" if={{!fullscreen}}>
|
122 | 125 | <iron-icon icon="player-icons:fullscreen"></iron-icon>
|
@@ -226,6 +229,8 @@ class MP4VideoPlayer extends PolymerElement {
|
226 | 229 | this.toFixed = 8;
|
227 | 230 | this.dragging = { volume: false, track: false };
|
228 | 231 | this.fullscreenChangeEvent = this._prefix === 'ms' ? 'MSFullscreenchange' : `${this._prefix}fullscreenchange`;
|
| 232 | + this.parser = new UAParser(); |
| 233 | + this.isIOSDevice = this.parser.getOS().name === 'iOS'; |
229 | 234 | }
|
230 | 235 |
|
231 | 236 | ready() {
|
|
0 commit comments