qin-player
v0.16.2
Published
An player that can play live streaming, like HLS or MJPG, and playback video, like MP4 or AVI.
Downloads
51
Readme
qin-player
Introduction
Qin Player is a module which allows to playback Motion JPEG videos, live streams, and videos that clappr offers to play.
Structure
Qin Player determines a playback strategy based on the video source specified in constructor's
argument. This implies that the first layer of Qin's interface applies strategy pattern,
where the abstract strategy is named PlaybackStrategy
and the concrete strategies are:
ClapprPlaybackStrategy
- .mp4, .m3u8, ...MjpgPlaybackStrategy
- .aviMjpgLiveStrategy
- Motion JPEG live stream on HTTP
Clappr Playback Strategy
ClapprPlaybackStrategy
is trivial for it is an implementation of clappr's usage. See more from
clappr.io.
MJPG Playback Strategy
MjpgPlaybackStrategy
is implemented as a state machine.
The states are:
- Init
- Buffering,
- Buffered,
- Playing,
- Paused,
- Stopped,
- PlaybackCompleted.
The transitions involve:
- seek(),
- play(),
- pause(),
- stop().
MJPG Live Strategy
MjpgLiveStrategy
realizes its behaviors by inserting http://.../.mjpg source into DOM with the
help of TabManager
.