P2P Media Loader - Shaka Player integration
P2P sharing of segmented media streams (i.e. HLS, MPEG-DASH) using WebRTC for Shaka Player
- P2P development, support & consulting
- Technical overview
- JS CDN
General steps are:
- Include P2P Medial Loader scripts.
- Create P2P Medial Loader engine instance.
- Create a player instance.
- Call init function for the player.
Shaka Player with P2P Media Loader
The library uses
window.p2pml.shaka as a root namespace in Web browser for:
Engine- Shaka Player support engine
version- API version
Shaka Player support engine.
Returns result from
engine = new Engine([settings])
Creates a new
forwardSegmentCount- Number of segments for building up predicted forward segments sequence; used to predownload and share via P2P. Default is 20.
maxHistorySegments- Maximum amount of requested segments manager should remember; used to build up sequence with correct priorities for P2P sharing. Default is 50.
swarmId- Override default swarm ID that is used to identify unique media stream with trackers (manifest URL without query parameters is used as the swarm ID if the parameter is not specified).
assetsStorage- A storage for the downloaded assets: manifests, subtitles, init segments, DRM assets etc. By default the assets are not stored. Can be used to implement offline plabyack. See AssetsStorage interface for details.
- settings for
HybridLoader(see P2P Media Loader Core API for details).
- settings for
Registers an event handler.
event- Event you want to handle; available events you can find here.
handler- Function to handle the event
Returns engine instance settings.
Returns engine instance details.
Destroys engine; destroy loader and segment manager.
Shaka Player integration.
player should be valid Shaka Player instance.
shakapolyfill;var engine = ;var video = document;var player = video;engine;player;