Skip to content

Commit

Permalink
typo: getPlayer() is now getYTPlayer()
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirish committed Mar 4, 2024
1 parent 2f56b7d commit a38a91b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Use [poster-image-availability.html](https://paulirish.github.io/lite-youtube-em
Use the `js-api` param: `<lite-youtube videoid="ogfYd705cRs" js-api>`.. Then you can use [IFrame Player API](https://developers.google.com/youtube/iframe_api_reference):

```js
const player = await document.querySelector('lite-youtube').getPlayer();
const player = await document.querySelector('lite-youtube').getYTPlayer();
player.seekTo(15); // jump to 15 seconds
```

Expand Down
2 changes: 1 addition & 1 deletion variants/js-api.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ <h1><code>lite-youtube</code> with JavaScript API</h1>
<script>
async function seekTo(id, seconds) {
let video = document.querySelector(`lite-youtube[videoid='${id}']`);
let player = await video.getPlayer();
let player = await video.getYTPlayer();
// https://developers.google.com/youtube/iframe_api_reference#seekTo
player?.seekTo(seconds, true);
}
Expand Down

0 comments on commit a38a91b

Please sign in to comment.