4.0.1 • Published 2 years ago
playah v4.0.1
about
Helps control video elements with autoplay available down to iOS 8.
setup
Download from the npm registry:
# Add to package.json
npm install playah
usage
Feed with a <video>
element as for example,
import createPlayer from "playah"
const video = document.createElement("video")
"playsinline loop autoplay".split(" ").forEach((v) => {
video.setAttribute(v, "")
})
video.setAttribute("src", "BigBuckBunny.mp4")
// Instantiating past video setup is
// kind of important in this example
const { play, stop } = createPlayer(video)
let paused = 1
video.addEventListener("loadstart", () => {
paused = 0
})
video.addEventListener("click", (e) => {
e.preventDefault()
paused = paused ? play() : stop()
}, false)
document.body.appendChild(video)
4.0.1
2 years ago
3.0.1
3 years ago
4.0.0
3 years ago
3.0.0
3 years ago
2.0.15
4 years ago
2.0.14
4 years ago
2.0.13
4 years ago
2.0.12
5 years ago
2.0.11
5 years ago
2.0.10
5 years ago
2.0.9
6 years ago
2.0.8
6 years ago
2.0.7
6 years ago
2.0.6
6 years ago
2.0.5
6 years ago
2.0.4
6 years ago
2.0.3
6 years ago
2.0.2
6 years ago
2.0.1
6 years ago
2.0.0
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago