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

Update README.md #631

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
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
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,22 @@ You can load the `ogv.js` main entry point directly in a script tag, or bundle i

ogv.js will try to auto-detect the path to its resources based on the script element that loads ogv.js or ogv-support.js. If you load ogv.js through another bundler (such as browserify or MediaWiki's ResourceLoader) you may need to override this manually before instantiating players:

```
```js
// Path to ogv-demuxer-ogg.js, ogv-worker-audio.js, etc
OGVLoader.base = '/path/to/resources';
```

To fetch from npm:

```
```shell
npm install ogv
```

The distribution-ready files will appear in 'node_modules/ogv/dist'.

To load the player library into your browserify or webpack project:

```
```js
var ogv = require('ogv');

// Access public classes either as ogv.OGVPlayer or just OGVPlayer.
Expand All @@ -168,7 +168,7 @@ var player = new ogv.OGVPlayer();

The `OGVPlayer` class implements a player, and supports a subset of the events, properties and methods from [HTMLMediaElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement) and [HTMLVideoElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLVideoElement).

```
```js
// Create a new player with the constructor
var player = new OGVPlayer();

Expand All @@ -189,7 +189,7 @@ The `OGVPlayer` class implements a player, and supports a subset of the events,

To check for compatibility before creating a player, include `ogv-support.js` and use the `OGVCompat` API:

```
```js
if (OGVCompat.supported('OGVPlayer')) {
// go load the full player from ogv.js and instantiate stuff
}
Expand All @@ -199,7 +199,7 @@ This will check for typed arrays, web audio, blacklisted iOS versions, and super

If you need a URL versioning/cache-buster parameter for dynamic loading of `ogv.js`, you can use the `OGVVersion` symbol provided by `ogv-support.js` or the even tinier `ogv-version.js`:

```
```js
var script = document.createElement('script');
script.src = 'ogv.js?version=' + encodeURIComponent(OGVVersion);
document.querySelector('head').appendChild(script);
Expand Down Expand Up @@ -303,7 +303,7 @@ Note that autoplay with audio doesn't work on iOS Safari due to limitations with

As of 1.1.1, muting before script-triggered playback allows things to work:

```
```js
player = new OGVPlayer();
player.muted = true;
player.src = 'path/to/file-with-audio.ogv';
Expand Down