Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: follow HTMLMediaElement interface (Breaking Change) #66

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3723e02
feat: define `play()` `pause()` `stop()`
leo6104 May 31, 2023
998ee23
refactor(player): use async await pattern for play()
leo6104 Jun 1, 2023
bf10ce5
refactor: change event name to 'play', 'pause'
leo6104 Jun 1, 2023
41ee92c
feat(canPlayType): add playType spec with partially support
leo6104 Jun 1, 2023
48ba7f7
feat: add paused property
leo6104 Jun 1, 2023
ee3d180
feat: add error event timing
leo6104 Jun 1, 2023
f07f8a4
feat: add error property
leo6104 Jun 1, 2023
db02adc
feat: add 'loadeddata', 'loadstart', 'canplay' event timing in `initP…
leo6104 Jun 1, 2023
ed10c4a
feat: add 'play', 'playing', 'ended' event timing
leo6104 Jun 1, 2023
e18e415
feat: add `load()` instance method (same with reload())
leo6104 Jun 1, 2023
7d3a5cc
feat: add 'timeupdate' event in note callback
leo6104 Jun 1, 2023
186e5bc
feat: support `autoplay` property
leo6104 Jun 1, 2023
5499b8e
fix(autoplay): add setter for autoplay
leo6104 Jun 1, 2023
258364a
refactor: do not specify 'cancellable', 'bubbles' (default value is f…
leo6104 Jun 1, 2023
5125ad0
feat: add fastSeek (same behavior with currentTime setter)
leo6104 Jun 1, 2023
499b1e1
feat: add 'seeking', 'seeked' event timing
leo6104 Jun 1, 2023
570262d
feat: add durationchange event for totalTime (duration)
leo6104 Jun 1, 2023
e036a3b
feat: add controls property input
leo6104 Jun 1, 2023
ecfc4d1
feat: add abort event timing
leo6104 Jun 1, 2023
fd6e1f6
refactor(canPlayType): use String.includes to check type value
leo6104 Jun 1, 2023
f285c9d
feat: add ended property & correct behavior for 'ended' event (consid…
leo6104 Jun 1, 2023
0d2bb91
refactor(paused): return false when !playerState || stopped case
leo6104 Jun 1, 2023
b507595
feat: add more event listeners in index.html (for test)
leo6104 Jun 1, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: add durationchange event for totalTime (duration)
leo6104 committed Jun 1, 2023
commit 570262da6cdd9d89f2fd0c9dc6c0b99fa41c8c45
2 changes: 2 additions & 0 deletions src/player.ts
Original file line number Diff line number Diff line change
@@ -179,9 +179,11 @@ export class PlayerElement extends HTMLElement {
if (ns) {
this.seekBar.max = String(ns.totalTime);
this.totalTimeLabel.textContent = utils.formatTime(ns.totalTime);
this.dispatchEvent(new CustomEvent('durationchange'));
} else {
this.seekBar.max = '0';
this.totalTimeLabel.textContent = utils.formatTime(0);
this.dispatchEvent(new CustomEvent('durationchange'));
return;
}