forked from vime-js/vime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: restructure project for simplicity
- Loading branch information
Showing
108 changed files
with
4,247 additions
and
2,740 deletions.
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
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
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Changelog | ||
|
||
Automatically generated by [semantic-release](https://github.com/semantic-release/semantic-release) | ||
and can be found on the [releases page](https://github.com/vime-js/vime/releases). | ||
Automatically generated by [semantic-release](https://github.com/semantic-release/semantic-release) | ||
and can be found on the [releases page](https://github.com/vime-js/vime/releases). |
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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# @vime/docs | ||
|
||
Vime is simply a collection of [web components](https://developer.mozilla.org/en-US/docs/Web/Web_Components) | ||
that help you easily build and customize your our own media player. This package contains the source | ||
code for the Vime documentation site hosted at https://vimejs.com. The website is built using | ||
[Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. | ||
|
||
### Local Development | ||
|
||
```bash | ||
$: npm install | ||
|
||
$: npm run start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are | ||
reflected live without having to restart the server. | ||
|
||
It's important to note that **`docs/components` is autogenerated** by `@vime/core`. If you'd like | ||
to update those docs run the following commands: | ||
|
||
```bash | ||
$: cd .. | ||
|
||
$: npm run setup | ||
|
||
$: cd packages/core | ||
|
||
# Update the docs inside `src/components` and then run: | ||
$: npm run build | ||
``` |
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,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
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,79 @@ | ||
--- | ||
title: vime-embed | ||
sidebar_label: Embed | ||
slug: api | ||
--- | ||
|
||
Embeds an external media player and enables interacting with it via `postMessage`. | ||
|
||
## Example | ||
|
||
```html | ||
<vime-embed | ||
embed-src="https://www.youtube-nocookie.com/embed/DyTCOwB0DVw" | ||
media-title="Agent 327: Operation Barbershop" | ||
origin="https://www.youtube-nocookie.com" | ||
/> | ||
|
||
<script> | ||
const embed = document.querySelector("vime-embed"); | ||
embed.params = { autoplay: 1, muted: 1, controls: 0 }; | ||
embed.addEventListener("vEmbedMessage", (e) => { | ||
const message = e.detail; | ||
console.log(message); | ||
}); | ||
</script> | ||
``` | ||
|
||
<!-- Auto Generated Below --> | ||
|
||
## Properties | ||
|
||
| Property | Attribute | Description | Type | Default | | ||
| ---------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ----------- | | ||
| `decoder` | -- | A function which accepts the raw message received from the embedded media player via `postMessage` and converts it into a POJO. | `((data: string) => Record<string, any> ∣ undefined) ∣ undefined` | `undefined` | | ||
| `embedSrc` | `embed-src` | A URL that will load the external player and media (Eg: https://www.youtube.com/embed/DyTCOwB0DVw). | `string` | `''` | | ||
| `mediaTitle` | `media-title` | The title of the current media so it can be set on the inner `iframe` for screen readers. | `string` | `''` | | ||
| `origin` | `origin` | Where the src request had originated from without any path information. | `string ∣ undefined` | `undefined` | | ||
| `params` | -- | The parameters to pass to the embedded player. These are encoded as a query string and appended to the `embedSrc` prop. | `{ [x: string]: any; }` | `{}` | | ||
| `preconnections` | -- | A collection of URLs to that the browser should immediately start establishing a connection with. | `string[]` | `[]` | | ||
|
||
## Events | ||
|
||
| Event | Description | Type | | ||
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- | | ||
| `vEmbedLoaded` | Emitted when the embedded player and any new media has loaded. | `CustomEvent<void>` | | ||
| `vEmbedMessage` | Emitted when a new message is received from the embedded player via `postMessage`. | `CustomEvent<any>` | | ||
| `vEmbedSrcChange` | Emitted when the `embedSrc` or `params` props change. The payload contains the `params` serialized into a query string and appended to `embedSrc`. | `CustomEvent<string>` | | ||
|
||
## Methods | ||
|
||
### `postMessage(message: any, target?: string | undefined) => Promise<void>` | ||
|
||
Posts a message to the embedded media player. | ||
|
||
#### Returns | ||
|
||
Type: `Promise<void>` | ||
|
||
## Dependencies | ||
|
||
### Used by | ||
|
||
- [vime-dailymotion](../../providers/dailymotion/readme.md) | ||
- [vime-vimeo](../../providers/vimeo/readme.md) | ||
- [vime-youtube](../../providers/youtube/readme.md) | ||
|
||
### Graph | ||
|
||
```mermaid | ||
graph TD; | ||
vime-dailymotion --> vime-embed | ||
vime-vimeo --> vime-embed | ||
vime-youtube --> vime-embed | ||
style vime-embed fill:#f9f,stroke:#333,stroke-width:4px | ||
``` | ||
|
||
--- | ||
|
||
_Built with [StencilJS](https://stenciljs.com/)_ |
Oops, something went wrong.