-
-
Notifications
You must be signed in to change notification settings - Fork 667
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a673a4a
commit 9c47ec9
Showing
6 changed files
with
98 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default { | ||
template: ` | ||
<audio :controls="this.controls" :autoplay="this.autoplay" :muted="this.muted"> | ||
<source :src="this.src" :type="this.type"> | ||
</audio> | ||
`, | ||
props: { | ||
controls: Boolean, | ||
autoplay: Boolean, | ||
muted: Boolean, | ||
src: String, | ||
type: String, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from ..element import Element | ||
from ..vue import register_component | ||
|
||
register_component('audio', __file__, 'audio.js') | ||
|
||
|
||
class Audio(Element): | ||
|
||
def __init__(self, src: str, *, | ||
type: str = 'audio/mpeg', controls: bool = True, autoplay: bool = False, muted: bool = False) -> None: | ||
"""Audio | ||
:param src: URL of the audio source | ||
:param type: MIME-type of the resource (default: 'audio/mpeg') | ||
:param controls: whether to show the audio controls, like play, pause, and volume (default: `True`) | ||
:param autoplay: whether to start playing the audio automatically (default: `False`) | ||
:param muted: whether the audio should be initially muted (default: `False`) | ||
See `here <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio#events>`_ | ||
for a list of events you can subscribe to using the generic event subscription `on()`. | ||
""" | ||
super().__init__('audio') | ||
self._props['src'] = src | ||
self._props['type'] = type | ||
self._props['controls'] = controls | ||
self._props['autoplay'] = autoplay | ||
self._props['muted'] = muted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export default { | ||
template: ` | ||
<video :controls="this.controls" :autoplay="this.autoplay" :muted="this.muted"> | ||
<source :src="this.src" :type="this.type"> | ||
</video> | ||
`, | ||
props: { | ||
controls: Boolean, | ||
autoplay: Boolean, | ||
muted: Boolean, | ||
src: String, | ||
type: String, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from ..element import Element | ||
from ..vue import register_component | ||
|
||
register_component('video', __file__, 'video.js') | ||
|
||
|
||
class Video(Element): | ||
|
||
def __init__(self, src: str, *, | ||
type: str = 'video/mp4', controls: bool = True, autoplay: bool = False, muted: bool = False) -> None: | ||
"""Video | ||
:param src: URL of the video source | ||
:param type: MIME-type of the resource (default: 'video/mp4') | ||
:param controls: whether to show the video controls, like play, pause, and volume (default: `True`) | ||
:param autoplay: whether to start playing the video automatically (default: `False`) | ||
:param muted: whether the video should be initially muted (default: `False`) | ||
See `here <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#events>`_ | ||
for a list of events you can subscribe to using the generic event subscription `on()`. | ||
""" | ||
super().__init__('video') | ||
self._props['src'] = src | ||
self._props['type'] = type | ||
self._props['controls'] = controls | ||
self._props['autoplay'] = autoplay | ||
self._props['muted'] = muted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters