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

Mistyped variable in example code #486

Open
kapipapi opened this issue Aug 27, 2024 · 0 comments
Open

Mistyped variable in example code #486

kapipapi opened this issue Aug 27, 2024 · 0 comments

Comments

@kapipapi
Copy link

Typo in docs/examples/hls/index.html JavaScript Code

Issue:
On line 25 of docs/examples/hls/index.html:

<script>
document.addEventListener('DOMContentLoaded', function () {
const videoEl = document.querySelector('#hls-video')
const hlsUrl = document.querySelector('#hls-url').value
if (Hls.isSupported()) {
const hls = new Hls()
hls.loadSource(hlsUrl)
hls.attachMedia(videoEl)
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
videoEl.src = hlsUrl
}
})
</script>

Suggested Fix:
Replace video.canPlayType with videoEl.canPlayType to ensure the correct variable is used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant