@@ -31,7 +31,7 @@ To use the custom element you will need to:
31
31
<script src =" node_modules/lite-youtube-embed/src/lite-yt-embed.js" ></script >
32
32
33
33
<!-- Use the element. You may use it before the lite-yt-embed JS is executed. -->
34
- <lite-youtube videoid =" ogfYd705cRs " playlabel =" Play: Keynote (Google I/O '18) " ></lite-youtube >
34
+ <lite-youtube videoid =" goiWrNiaT0I " playlabel =" Play: Crayon Physics Deluxe - Trailer HD " ></lite-youtube >
35
35
```
36
36
37
37
<br >
@@ -44,9 +44,9 @@ to be more privacy friendly for end users.
44
44
Use this as your HTML, load the script asynchronously, and let the JS progressively enhance it.
45
45
46
46
``` html
47
- <lite-youtube videoid =" ogfYd705cRs " style =" background-image : url (' https://i.ytimg.com/vi/ogfYd705cRs /hqdefault.jpg' );" >
48
- <a href =" https://youtube.com/watch?v=ogfYd705cRs " class =" lty-playbtn" title =" Play Video" >
49
- <span class =" lyt-visually-hidden" >Play Video: Keynote (Google I/O '18) </span >
47
+ <lite-youtube videoid =" goiWrNiaT0I " style =" background-image : url (' https://i.ytimg.com/vi/goiWrNiaT0I /hqdefault.jpg' );" >
48
+ <a href =" https://youtube.com/watch?v=goiWrNiaT0I " class =" lty-playbtn" title =" Play Video" >
49
+ <span class =" lyt-visually-hidden" >Play Video: Crayon Physics Deluxe - Trailer HD </span >
50
50
</a >
51
51
</lite-youtube >
52
52
```
@@ -57,14 +57,14 @@ Use this as your HTML, load the script asynchronously, and let the JS progressiv
57
57
58
58
If you want to provide a custom poster image, just set it as the background-image, and lite-yt will not overwrite it:
59
59
``` html
60
- <lite-youtube videoid =" ogfYd705cRs " style =" background-image : url (' https://i.ytimg.com/vi/ogfYd705cRs /hqdefault.jpg' );" ></lite-youtube >
60
+ <lite-youtube videoid =" goiWrNiaT0I " style =" background-image : url (' https://i.ytimg.com/vi/goiWrNiaT0I /hqdefault.jpg' );" ></lite-youtube >
61
61
```
62
62
63
63
Use [ poster-image-availability.html] ( https://paulirish.github.io/lite-youtube-embed/testpage/poster-image-availability.html ) to determine what poster images are available for you.
64
64
65
65
## Access the YouTube Iframe Player API
66
66
67
- 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 ) :
67
+ Use the ` js-api ` param: ` <lite-youtube videoid="goiWrNiaT0I " js-api> ` .. Then you can use [ IFrame Player API] ( https://developers.google.com/youtube/iframe_api_reference ) :
68
68
69
69
``` js
70
70
const player = await document .querySelector (' lite-youtube' ).getYTPlayer ();
@@ -77,7 +77,7 @@ player.seekTo(15); // jump to 15 seconds
77
77
78
78
If you want to display a title prior to loading the full embed, set the ` title ` attribute:
79
79
``` html
80
- <lite-youtube videoid =" ogfYd705cRs " title =" Keynote (Google I/O '18) " ></lite-youtube >
80
+ <lite-youtube videoid =" goiWrNiaT0I " title =" Crayon Physics Deluxe - Trailer HD " ></lite-youtube >
81
81
```
82
82
83
83
[ Demo: visible title] ( https://paulirish.github.io/lite-youtube-embed/variants/title.html )
@@ -90,7 +90,7 @@ These may be applied by using the `params` attribute.
90
90
``` html
91
91
<!-- Example to show a video player without controls, starting at 10s in, ending at 20s,
92
92
with modest branding *and* enabling the JS API -->
93
- <lite-youtube videoid =" ogfYd705cRs " params =" controls=0&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1" ></lite-youtube >
93
+ <lite-youtube videoid =" goiWrNiaT0I " params =" controls=0&start=10&end=30&modestbranding=2&rel=0&enablejsapi=1" ></lite-youtube >
94
94
```
95
95
96
96
Note that lite-youtube uses ` autoplay=1 ` by default.
0 commit comments