Skip to content

Commit 1b88628

Browse files
committed
Fix lty- typo, but keep fallback around to avoid breakage
Fixes #65
1 parent 8728048 commit 1b88628

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Use this as your HTML, load the script asynchronously, and let the JS progressiv
4545

4646
```html
4747
<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">
48+
<a href="https://youtube.com/watch?v=goiWrNiaT0I" class="lyt-playbtn" title="Play Video">
4949
<span class="lyt-visually-hidden">Play Video: Crayon Physics Deluxe - Trailer HD</span>
5050
</a>
5151
</lite-youtube>

src/lite-yt-embed.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ lite-youtube > iframe {
5252
}
5353

5454
/* play button */
55-
lite-youtube > .lty-playbtn {
55+
lite-youtube > .lyt-playbtn {
5656
display: block;
5757
/* Make the button element cover the whole area for a large hover/click target… */
5858
width: 100%;
@@ -69,8 +69,8 @@ lite-youtube > .lty-playbtn {
6969
border: 0;
7070
}
7171

72-
lite-youtube:hover > .lty-playbtn,
73-
lite-youtube .lty-playbtn:focus {
72+
lite-youtube:hover > .lyt-playbtn,
73+
lite-youtube .lyt-playbtn:focus {
7474
filter: none;
7575
}
7676

@@ -79,7 +79,7 @@ lite-youtube.lyt-activated {
7979
cursor: unset;
8080
}
8181
lite-youtube.lyt-activated::before,
82-
lite-youtube.lyt-activated > .lty-playbtn {
82+
lite-youtube.lyt-activated > .lyt-playbtn {
8383
opacity: 0;
8484
pointer-events: none;
8585
}

src/lite-yt-embed.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class LiteYTEmbed extends HTMLElement {
1414
connectedCallback() {
1515
this.videoId = this.getAttribute('videoid');
1616

17-
let playBtnEl = this.querySelector('.lty-playbtn');
17+
let playBtnEl = this.querySelector('.lyt-playbtn,.lty-playbtn');
1818
// A label for the button takes priority over a [playlabel] attribute on the custom-element
1919
this.playLabel = (playBtnEl && playBtnEl.textContent.trim()) || this.getAttribute('playlabel') || 'Play';
2020

@@ -34,7 +34,8 @@ class LiteYTEmbed extends HTMLElement {
3434
if (!playBtnEl) {
3535
playBtnEl = document.createElement('button');
3636
playBtnEl.type = 'button';
37-
playBtnEl.classList.add('lty-playbtn');
37+
// Include the mispelled 'lty-' in case it's still being used. https://github.com/paulirish/lite-youtube-embed/issues/65
38+
playBtnEl.classList.add('lyt-playbtn', 'lty-playbtn');
3839
this.append(playBtnEl);
3940
}
4041
if (!playBtnEl.textContent) {

testpage/poster-image-summary.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@
117117
"saaTXQ7E3Lw",
118118
"bJcTWr8-mFo",
119119
"jWur1VrxNUg",
120+
"UMPhhk1K_9s", // artifacts are BAD in hqdefault jpeg
120121
"b52cfb6lweU",
121122
"svEuG_ekNT0",
122123
"goiWrNiaT0I",

variants/pe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ <h1>Progressively Enhanced</h1>
1212
<p id="done">...</p>
1313

1414
<lite-youtube videoid="goiWrNiaT0I" style="background-image: url('https://i.ytimg.com/vi/goiWrNiaT0I/hqdefault.jpg');">
15-
<a href="https://youtube.com/watch?v=goiWrNiaT0I" class="lty-playbtn" title="Play Video">
15+
<a href="https://youtube.com/watch?v=goiWrNiaT0I" class="lyt-playbtn" title="Play Video">
1616
<span class="lyt-visually-hidden">Play Video: Crayon Physics Deluxe - Trailer HD</span>
1717
</a>
1818
</lite-youtube>

0 commit comments

Comments
 (0)