@outbook/webcomponents-player-timeline 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/player-timeline.js +42 -32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@outbook/webcomponents-player-timeline",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "player-timeline.js",
5
5
  "type": "module",
6
6
  "private": false,
@@ -177,43 +177,52 @@ function ComponentPlayerTimeline(element) {
177
177
  ></div>
178
178
  `;
179
179
  })}
180
- <div
181
- class="player-timeline__completed"
182
- style="width:${isDragging ? progressVisible : progress}%;"
183
- >
184
- <div class="player-timeline__thumb"></div>
185
- </div>
180
+ ${totalTime > 0
181
+ ? html`
182
+ <div
183
+ class="player-timeline__completed"
184
+ style="width:${isDragging ? progressVisible : progress}%;"
185
+ >
186
+ <div class="player-timeline__thumb"></div>
187
+ </div>
188
+ `
189
+ : nothing}
186
190
  </div>
187
- <div
188
- class="player-timeline__track-real"
189
- @click="${handleTimeline}"
190
- @keydown="${handleTimeline}"
191
- @mousemove="${handleThumbMouseMove}"
192
- @touchmove="${ifDefined(
193
- isTouch() ? handleThumbTouchMove : undefined
194
- )}"
195
- @mouseout="${handleTimelineOut}"
196
- @mousedown="${handleThumbMouseDown}"
197
- @touchstart="${ifDefined(
198
- isTouch() ? handleThumbMouseDown : undefined
199
- )}"
200
- @mouseup="${handleThumbMouseUp}"
201
- @touchend="${ifDefined(isTouch() ? handleThumbTouchEnd : undefined)}"
202
- aria-valuemin="0"
203
- aria-valuemax="100"
204
- aria-valuenow="${progress}"
205
- aria-valuetext="${a11yTime({ time: currentTime, literals })}"
206
- role="slider"
207
- tabindex="0"
208
- ></div>
191
+ ${totalTime > 0
192
+ ? html`
193
+ <div
194
+ class="player-timeline__track-real"
195
+ @click="${handleTimeline}"
196
+ @keydown="${handleTimeline}"
197
+ @mousemove="${handleThumbMouseMove}"
198
+ @touchmove="${ifDefined(
199
+ isTouch() ? handleThumbTouchMove : undefined
200
+ )}"
201
+ @mouseout="${handleTimelineOut}"
202
+ @mousedown="${handleThumbMouseDown}"
203
+ @touchstart="${ifDefined(
204
+ isTouch() ? handleThumbMouseDown : undefined
205
+ )}"
206
+ @mouseup="${handleThumbMouseUp}"
207
+ @touchend="${ifDefined(
208
+ isTouch() ? handleThumbTouchEnd : undefined
209
+ )}"
210
+ aria-valuemin="0"
211
+ aria-valuemax="100"
212
+ aria-valuenow="${progress}"
213
+ aria-valuetext="${a11yTime({ time: currentTime, literals })}"
214
+ role="slider"
215
+ tabindex="0"
216
+ ></div>
217
+ `
218
+ : nothing}
209
219
  </div>
210
220
  <div class="player-timeline__numbers">
211
221
  <div>${formatTime(currentTime)}</div>
212
222
  <div>${formatTime(totalTime)}</div>
213
223
  </div>
214
- ${timePosition === null
215
- ? nothing
216
- : html`
224
+ ${timePosition && totalTime > 0
225
+ ? html`
217
226
  <div
218
227
  class="player-timeline__tooltip"
219
228
  style="--timeline-tooltip-position: ${timePosition.left}px;"
@@ -231,7 +240,8 @@ function ComponentPlayerTimeline(element) {
231
240
  </span>
232
241
  </div>
233
242
  </div>
234
- `}
243
+ `
244
+ : nothing}
235
245
  </div>
236
246
  `;
237
247
  }