Pyckplayer 1.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. pyckplayer/__init__.py +6 -0
  2. pyckplayer/ckplayer/LICENSE +202 -0
  3. pyckplayer/ckplayer/css/ckplayer.css +1609 -0
  4. pyckplayer/ckplayer/css/ckplayer.ixigua.css +1707 -0
  5. pyckplayer/ckplayer/css/ckplayer.red.css +1609 -0
  6. pyckplayer/ckplayer/css/images/adclose.png +0 -0
  7. pyckplayer/ckplayer/css/images/buffer.png +0 -0
  8. pyckplayer/ckplayer/css/images/ckplayer.48.png +0 -0
  9. pyckplayer/ckplayer/css/images/ckplayer.png +0 -0
  10. pyckplayer/ckplayer/css/images/ckplayer_ixigua.48.png +0 -0
  11. pyckplayer/ckplayer/css/images/ckplayer_ixigua.png +0 -0
  12. pyckplayer/ckplayer/css/images/ckplayer_red.48.png +0 -0
  13. pyckplayer/ckplayer/css/images/ckplayer_red.png +0 -0
  14. pyckplayer/ckplayer/css/images/favicon.ico +0 -0
  15. pyckplayer/ckplayer/css/images/loading.png +0 -0
  16. pyckplayer/ckplayer/css/images/logo.png +0 -0
  17. pyckplayer/ckplayer/css/images/play.png +0 -0
  18. pyckplayer/ckplayer/flv.js/LICENSE +202 -0
  19. pyckplayer/ckplayer/flv.js/README.md +104 -0
  20. pyckplayer/ckplayer/flv.js/flv.js +10585 -0
  21. pyckplayer/ckplayer/flv.js/flv.js.map +1 -0
  22. pyckplayer/ckplayer/flv.js/flv.min.js +10 -0
  23. pyckplayer/ckplayer/flv.js/flv.min.js.map +1 -0
  24. pyckplayer/ckplayer/hls.js/LICENSE +28 -0
  25. pyckplayer/ckplayer/hls.js/README.md +442 -0
  26. pyckplayer/ckplayer/hls.js/hls-demo.js +42195 -0
  27. pyckplayer/ckplayer/hls.js/hls-demo.js.map +1 -0
  28. pyckplayer/ckplayer/hls.js/hls.js +27804 -0
  29. pyckplayer/ckplayer/hls.js/hls.js.d.ts +2837 -0
  30. pyckplayer/ckplayer/hls.js/hls.js.map +1 -0
  31. pyckplayer/ckplayer/hls.js/hls.light.js +20929 -0
  32. pyckplayer/ckplayer/hls.js/hls.light.js.map +1 -0
  33. pyckplayer/ckplayer/hls.js/hls.light.min.js +2 -0
  34. pyckplayer/ckplayer/hls.js/hls.light.min.js.map +1 -0
  35. pyckplayer/ckplayer/hls.js/hls.min.js +2 -0
  36. pyckplayer/ckplayer/hls.js/hls.min.js.map +1 -0
  37. pyckplayer/ckplayer/js/ckplayer.js +7421 -0
  38. pyckplayer/ckplayer/js/ckplayer.min.js +7 -0
  39. pyckplayer/ckplayer/language/en.js +72 -0
  40. pyckplayer/ckplayer/language/zh.cn.js +72 -0
  41. pyckplayer/ckplayer/language/zh.hk.js +72 -0
  42. pyckplayer/ckplayer/mpegts.js/LICENSE +202 -0
  43. pyckplayer/ckplayer/mpegts.js/mpegts.js +9 -0
  44. pyckplayer/ckplayer/mpegts.js/mpegts.js.map +1 -0
  45. pyckplayer/ckplayer/mpegts.js/mpegts.min.js +9 -0
  46. pyckplayer/cli.py +33 -0
  47. pyckplayer/core.py +218 -0
  48. pyckplayer-1.0.0.dist-info/METADATA +114 -0
  49. pyckplayer-1.0.0.dist-info/RECORD +53 -0
  50. pyckplayer-1.0.0.dist-info/WHEEL +5 -0
  51. pyckplayer-1.0.0.dist-info/entry_points.txt +2 -0
  52. pyckplayer-1.0.0.dist-info/licenses/LICENSE +202 -0
  53. pyckplayer-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2017 Dailymotion (http://www.dailymotion.com)
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License.
14
+
15
+ src/remux/mp4-generator.js and src/demux/exp-golomb.ts implementation in this project
16
+ are derived from the HLS library for video.js (https://github.com/videojs/videojs-contrib-hls)
17
+
18
+ That work is also covered by the Apache 2 License, following copyright:
19
+ Copyright (c) 2013-2015 Brightcove
20
+
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
+ THE SOFTWARE.
@@ -0,0 +1,442 @@
1
+ [![npm](https://img.shields.io/npm/v/hls.js.svg?style=flat)](https://npmjs.org/package/hls.js)
2
+ [![npm](https://img.shields.io/npm/v/hls.js/canary.svg?style=flat)](https://www.npmjs.com/package/hls.js/v/canary)
3
+ [![](https://data.jsdelivr.com/v1/package/npm/hls.js/badge?style=rounded)](https://www.jsdelivr.com/package/npm/hls.js)
4
+ [![Sauce Test Status](https://saucelabs.com/buildstatus/robwalch)](https://app.saucelabs.com/u/robwalch)
5
+
6
+ [comment]: <> ([![Sauce Test Status]&#40;https://saucelabs.com/browser-matrix/robwalch.svg&#41;]&#40;https://saucelabs.com/u/robwalch&#41;)
7
+
8
+ # ![HLS.js](https://cloud.githubusercontent.com/assets/616833/19739063/e10be95a-9bb9-11e6-8100-2896f8500138.png)
9
+
10
+ HLS.js is a JavaScript library that implements an [HTTP Live Streaming] client.
11
+ It relies on [HTML5 video][] and [MediaSource Extensions][] for playback.
12
+
13
+ It works by transmuxing MPEG-2 Transport Stream and AAC/MP3 streams into ISO BMFF (MP4) fragments.
14
+ Transmuxing is performed asynchronously using a [Web Worker] when available in the browser.
15
+ HLS.js also supports HLS + fmp4, as announced during [WWDC2016](https://developer.apple.com/videos/play/wwdc2016/504/).
16
+
17
+ HLS.js works directly on top of a standard HTML`<video>` element.
18
+
19
+ HLS.js is written in [ECMAScript6] (`*.js`) and [TypeScript] (`*.ts`) (strongly typed superset of ES6), and transpiled in ECMAScript5 using [Babel](https://babeljs.io/) and the [TypeScript compiler].
20
+
21
+ [Webpack] is used to build the distro bundle and serve the local development environment.
22
+
23
+ [html5 video]: https://www.html5rocks.com/en/tutorials/video/basics/
24
+ [mediasource extensions]: https://w3c.github.io/media-source/
25
+ [http live streaming]: https://en.wikipedia.org/wiki/HTTP_Live_Streaming
26
+ [web worker]: https://caniuse.com/#search=worker
27
+ [ecmascript6]: https://github.com/ericdouglas/ES6-Learning#articles--tutorials
28
+ [typescript]: https://www.typescriptlang.org/
29
+ [typescript compiler]: https://www.typescriptlang.org/docs/handbook/compiler-options.html
30
+ [webpack]: https://webpack.js.org/
31
+
32
+ ## Features
33
+
34
+ - VOD & Live playlists
35
+ - DVR support on Live playlists
36
+ - Fragmented MP4 container
37
+ - MPEG-2 TS container
38
+ - ITU-T Rec. H.264 and ISO/IEC 14496-10 Elementary Stream
39
+ - ISO/IEC 13818-7 ADTS AAC Elementary Stream
40
+ - ISO/IEC 11172-3 / ISO/IEC 13818-3 (MPEG-1/2 Audio Layer III) Elementary Stream
41
+ - Packetized metadata (ID3v2.3.0) Elementary Stream
42
+ - AAC container (audio only streams)
43
+ - MPEG Audio container (MPEG-1/2 Audio Layer III audio only streams)
44
+ - Timed Metadata for HTTP Live Streaming (in ID3 format, carried in MPEG-2 TS)
45
+ - AES-128 decryption
46
+ - SAMPLE-AES decryption (only supported if using MPEG-2 TS container)
47
+ - Encrypted media extensions (EME) support for DRM (digital rights management)
48
+ - Widevine CDM (only tested with [shaka-packager](https://github.com/google/shaka-packager) test-stream on [the demo page](https://hls-js.netlify.app/demo/?src=https%3A%2F%2Fstorage.googleapis.com%2Fshaka-demo-assets%2Fangel-one-widevine-hls%2Fhls.m3u8&demoConfig=eyJlbmFibGVTdHJlYW1pbmciOnRydWUsImF1dG9SZWNvdmVyRXJyb3IiOnRydWUsInN0b3BPblN0YWxsIjpmYWxzZSwiZHVtcGZNUDQiOmZhbHNlLCJsZXZlbENhcHBpbmciOi0xLCJsaW1pdE1ldHJpY3MiOi0xfQ==))
49
+ - CEA-608/708 captions
50
+ - WebVTT subtitles
51
+ - Alternate Audio Track Rendition (Master Playlist with Alternative Audio) for VoD and Live playlists
52
+ - Adaptive streaming
53
+ - Manual & Auto Quality Switching
54
+ - 3 Quality Switching modes are available (controllable through API means)
55
+ - Instant switching (immediate quality switch at current video position)
56
+ - Smooth switching (quality switch for next loaded fragment)
57
+ - Bandwidth conservative switching (quality switch change for next loaded fragment, without flushing the buffer)
58
+ - In Auto-Quality mode, emergency switch down in case bandwidth is suddenly dropping to minimize buffering.
59
+ - Accurate Seeking on VoD & Live (not limited to fragment or keyframe boundary)
60
+ - Ability to seek in buffer and back buffer without redownloading segments
61
+ - Built-in Analytics
62
+ - All internal events can be monitored (Network Events, Video Events)
63
+ - Playback session metrics are also exposed
64
+ - Resilience to errors
65
+ - Retry mechanism embedded in the library
66
+ - Recovery actions can be triggered fix fatal media or network errors
67
+ - [Redundant/Failover Playlists](https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/StreamingMediaGuide/UsingHTTPLiveStreaming/UsingHTTPLiveStreaming.html#//apple_ref/doc/uid/TP40008332-CH102-SW22)
68
+
69
+ ### Supported M3U8 tags
70
+
71
+ For details on the HLS format and these tags' meanings, see https://tools.ietf.org/html/draft-pantos-hls-rfc8216bis-08
72
+
73
+ #### Manifest tags
74
+
75
+ - `#EXT-X-STREAM-INF:<attribute-list>`
76
+ `<URI>`
77
+ - `#EXT-X-MEDIA:<attribute-list>`
78
+ - `#EXT-X-SESSION-DATA:<attribute-list>`
79
+
80
+ The following properties are added to their respective variants' attribute list but are not implemented in their selection and playback.
81
+
82
+ - `VIDEO-RANGE` and `HDCP-LEVEL` (See [#2489](https://github.com/video-dev/hls.js/issues/2489))
83
+
84
+ #### Playlist tags
85
+
86
+ - `#EXTM3U`
87
+ - `#EXT-X-VERSION=<n>`
88
+ - `#EXTINF:<duration>,[<title>]`
89
+ - `#EXT-X-ENDLIST`
90
+ - `#EXT-X-MEDIA-SEQUENCE=<n>`
91
+ - `#EXT-X-TARGETDURATION=<n>`
92
+ - `#EXT-X-DISCONTINUITY`
93
+ - `#EXT-X-DISCONTINUITY-SEQUENCE=<n>`
94
+ - `#EXT-X-BYTERANGE=<n>[@<o>]`
95
+ - `#EXT-X-MAP:<attribute-list>`
96
+ - `#EXT-X-KEY:<attribute-list>` (`METHOD=SAMPLE-AES` is only supports with MPEG-2 TS segments)
97
+ - `#EXT-X-PROGRAM-DATE-TIME:<attribute-list>`
98
+ - `#EXT-X-START:TIME-OFFSET=<n>`
99
+ - `#EXT-X-SERVER-CONTROL:<attribute-list>`
100
+ - `#EXT-X-PART-INF:PART-TARGET=<n>`
101
+ - `#EXT-X-PART:<attribute-list>`
102
+ - `#EXT-X-PRELOAD-HINT:<attribute-list>`
103
+ - `#EXT-X-SKIP:<attribute-list>`
104
+ - `#EXT-X-RENDITION-REPORT:<attribute-list>`
105
+
106
+ The following tags are added to their respective fragment's attribute list but are not implemented in streaming and playback.
107
+
108
+ - `#EXT-X-DATERANGE:<attribute-list>` (Not added to metadata TextTracks. See [#2218](https://github.com/video-dev/hls.js/issues/2218))
109
+ - `#EXT-X-BITRATE` (Not used in ABR controller)
110
+ - `#EXT-X-GAP` (Not implemented. See [#2940](https://github.com/video-dev/hls.js/issues/2940))
111
+
112
+ ### Not Supported
113
+
114
+ For a complete list of issues, see ["Top priorities" in the Release Planning and Backlog project tab](https://github.com/video-dev/hls.js/projects/6). Codec support is dependent on the runtime environment (for example, not all browsers on the same OS support HEVC).
115
+
116
+ - CMAF CC support [#2623](https://github.com/video-dev/hls.js/issues/2623)
117
+ - `Emsg` Inband Timed Metadata for FMP4 (ID3 within Emsgv1) in "metadata" TextTracks [#2360](https://github.com/video-dev/hls.js/issues/2360)
118
+ - `#EXT-X-DATERANGE` in "metadata" TextTracks [#2218](https://github.com/video-dev/hls.js/issues/2218)
119
+ - `#EXT-X-GAP` filling [#2940](https://github.com/video-dev/hls.js/issues/2940)
120
+ - `#EXT-X-I-FRAME-STREAM-INF` I-frame Media Playlist files
121
+ - `SAMPLE-AES` with fmp4, aac, mp3, vtt... segments (MPEG-2 TS only)
122
+ - PlayReady and FairPlay DRM ( See [#3779](https://github.com/video-dev/hls.js/issues/2360) and [issues labeled DRM](https://github.com/video-dev/hls.js/issues?q=is%3Aissue+is%3Aopen+label%3ADRM))
123
+ - Advanced variant selection based on runtime media capabilities (See issues labeled [`media-capabilities`](https://github.com/video-dev/hls.js/labels/media-capabilities))
124
+ - MP3 elementary stream audio in IE and Edge (<=18) on Windows 10 (See [#1641](https://github.com/video-dev/hls.js/issues/1641) and [Microsoft answers forum](https://answers.microsoft.com/en-us/ie/forum/all/ie11-on-windows-10-cannot-play-hls-with-mp3/2da994b5-8dec-4ae9-9201-7d138ede49d9))
125
+
126
+ ### Server-side-rendering (SSR) and `require` from a Node.js runtime
127
+
128
+ You can safely require this library in Node and **absolutely nothing will happen**. A dummy object is exported so that requiring the library does not throw an error. HLS.js is not instantiable in Node.js. See [#1841](https://github.com/video-dev/hls.js/pull/1841) for more details.
129
+
130
+ ## Getting started with development
131
+
132
+ First, checkout the repository and install the required dependencies
133
+
134
+ ```sh
135
+ git clone https://github.com/video-dev/hls.js.git
136
+ cd hls.js
137
+ # After cloning or pulling from the repository, make sure all dependencies are up-to-date
138
+ npm install ci
139
+ # Run dev-server for demo page (recompiles on file-watch, but doesn't write to actual dist fs artifacts)
140
+ npm run dev
141
+ # After making changes run the sanity-check task to verify all checks before committing changes
142
+ npm run sanity-check
143
+ ```
144
+
145
+ The dev server will host files on port 8000. Once started, the demo can be found running at http://localhost:8000/demo/.
146
+
147
+ Before submitting a PR, please see our [contribution guidelines](CONTRIBUTING.md).
148
+ Join the discussion on Slack via [video-dev.org](https://video-dev.org) in #hlsjs for updates and questions about development.
149
+
150
+ ### Build tasks
151
+
152
+ Build all flavors (suitable for prod-mode/CI):
153
+
154
+ ```
155
+ npm install ci
156
+ npm run build
157
+ ```
158
+
159
+ Only debug-mode artifacts:
160
+
161
+ ```
162
+ npm run build:debug
163
+ ```
164
+
165
+ Build and watch (customized dev setups where you'll want to host through another server than webpacks' - for example in a sub-module/project)
166
+
167
+ ```
168
+ npm run build:watch
169
+ ```
170
+
171
+ Only specific flavor (known configs are: debug, dist, light, light-dist, demo):
172
+
173
+ ```
174
+ npm run build -- --env dist # replace "dist" by other configuration name, see above ^
175
+ ```
176
+
177
+ Note: The "demo" config is always built.
178
+
179
+ **NOTE:** `hls.light.*.js` dist files do not include EME, subtitles, CMCD, or alternate-audio support. In addition,
180
+ the following types are not available in the light build:
181
+
182
+ - `AudioStreamController`
183
+ - `AudioTrackController`
184
+ - `CuesInterface`
185
+ - `EMEController`
186
+ - `SubtitleStreamController`
187
+ - `SubtitleTrackController`
188
+ - `TimelineController`
189
+ - `CmcdController`
190
+
191
+ ### Linter (ESlint)
192
+
193
+ Run linter:
194
+
195
+ ```
196
+ npm run lint
197
+ ```
198
+
199
+ Run linter with auto-fix mode:
200
+
201
+ ```
202
+ npm run lint:fix
203
+ ```
204
+
205
+ Run linter with errors only (no warnings)
206
+
207
+ ```
208
+ npm run lint:quiet
209
+ ```
210
+
211
+ ### Formatting Code
212
+
213
+ Run prettier to format code
214
+
215
+ ```
216
+ npm run prettier
217
+ ```
218
+
219
+ ### Type Check
220
+
221
+ Run type-check to verify TypeScript types
222
+
223
+ ```
224
+ npm run type-check
225
+ ```
226
+
227
+ ### Automated tests (Mocha/Karma)
228
+
229
+ Run all tests at once:
230
+
231
+ ```
232
+ npm test
233
+ ```
234
+
235
+ Run unit tests:
236
+
237
+ ```
238
+ npm run test:unit
239
+ ```
240
+
241
+ Run unit tests in watch mode:
242
+
243
+ ```
244
+ npm run test:unit:watch
245
+ ```
246
+
247
+ Run functional (integration) tests:
248
+
249
+ ```
250
+ npm run test:func
251
+ ```
252
+
253
+ ## Design
254
+
255
+ An overview of this project's design, it's modules, events, and error handling can be found [here](/docs/design.md).
256
+
257
+ ## API docs and usage guide
258
+
259
+ - [API and usage docs, with code examples](./docs/API.md)
260
+ - [Auto-Generated API Docs (Latest Release)](https://hls-js.netlify.com/api-docs)
261
+ - [Auto-Generated API Docs (Development Branch)](https://hls-js-dev.netlify.com/api-docs)
262
+
263
+ _Note you can access the docs for a particular version using "[https://github.com/video-dev/hls.js/tree/deployments](https://github.com/video-dev/hls.js/tree/deployments)"_
264
+
265
+ ## Demo
266
+
267
+ ### Latest Release
268
+
269
+ [https://hls-js.netlify.com/demo](https://hls-js.netlify.com/demo)
270
+
271
+ ### Master
272
+
273
+ [https://hls-js-dev.netlify.com/demo](https://hls-js-dev.netlify.com/demo)
274
+
275
+ ### Specific Version
276
+
277
+ Find the commit on [https://github.com/video-dev/hls.js/tree/deployments](https://github.com/video-dev/hls.js/tree/deployments).
278
+
279
+ [![](https://www.netlify.com/img/global/badges/netlify-color-accent.svg)](https://www.netlify.com)
280
+
281
+ [![](https://opensource.saucelabs.com/images/opensauce/powered-by-saucelabs-badge-gray.png?sanitize=true)](https://saucelabs.com)
282
+
283
+ ## Compatibility
284
+
285
+ HLS.js is only compatible with browsers supporting MediaSource extensions (MSE) API with 'video/MP4' mime-type inputs.
286
+
287
+ HLS.js is supported on:
288
+
289
+ - Chrome 39+ for Android
290
+ - Chrome 39+ for Desktop
291
+ - Firefox 41+ for Android
292
+ - Firefox 42+ for Desktop
293
+ - IE11 for Windows 8.1+
294
+ - Edge for Windows 10+
295
+ - Safari 8+ for MacOS 10.10+
296
+ - Safari for ipadOS 13+
297
+
298
+ A [Promise polyfill](https://github.com/taylorhakes/promise-polyfill) is required in browsers missing native promise support.
299
+
300
+ **Please note:** iOS Safari on iPhone does not support the MediaSource API. This includes all browsers on iOS as well as apps using UIWebView and WKWebView.
301
+
302
+ Safari browsers (iOS, iPadOS, and macOS) have built-in HLS support through the plain video "tag" source URL. See the example below (Using HLS.js) to run appropriate feature detection and choose between using HLS.js or natively built-in HLS support.
303
+
304
+ When a platform has neither MediaSource nor native HLS support, the browser cannot play HLS.
305
+
306
+ _Keep in mind that if the intention is to support HLS on multiple platforms, beyond those compatible with HLS.js, the HLS streams need to strictly follow the specifications of RFC8216, especially if apps, smart TVs, and set-top boxes are to be supported._
307
+
308
+ Find a support matrix of the MediaSource API here: https://developer.mozilla.org/en-US/docs/Web/API/MediaSource
309
+
310
+ ## Using HLS.js
311
+
312
+ ### Installation
313
+
314
+ Prepackaged builds are included [with each release](https://github.com/video-dev/hls.js/releases). Or install the hls.js as a dependency
315
+ of your project:
316
+
317
+ ```sh
318
+ npm install --save hls.js
319
+ ```
320
+
321
+ A canary channel is also available if you prefer to work off the development branch (master):
322
+
323
+ ```
324
+ npm install hls.js@canary
325
+ ```
326
+
327
+ ### Embedding HLS.js
328
+
329
+ Directly include dist/hls.js or dist/hls.min.js in a script tag on the page. This setup prioritizes HLS.js MSE playback over
330
+ native browser support for HLS playback in HTMLMediaElements:
331
+
332
+ ```html
333
+ <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
334
+ <!-- Or if you want a more recent alpha version -->
335
+ <!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@alpha"></script> -->
336
+ <video id="video"></video>
337
+ <script>
338
+ var video = document.getElementById('video');
339
+ var videoSrc = 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8';
340
+ if (Hls.isSupported()) {
341
+ var hls = new Hls();
342
+ hls.loadSource(videoSrc);
343
+ hls.attachMedia(video);
344
+ }
345
+ // HLS.js is not supported on platforms that do not have Media Source
346
+ // Extensions (MSE) enabled.
347
+ //
348
+ // When the browser has built-in HLS support (check using `canPlayType`),
349
+ // we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video
350
+ // element through the `src` property. This is using the built-in support
351
+ // of the plain video element, without using HLS.js.
352
+ //
353
+ // Note: it would be more normal to wait on the 'canplay' event below however
354
+ // on Safari (where you are most likely to find built-in HLS support) the
355
+ // video.src URL must be on the user-driven white-list before a 'canplay'
356
+ // event will be emitted; the last video event that can be reliably
357
+ // listened-for when the URL is not on the white-list is 'loadedmetadata'.
358
+ else if (video.canPlayType('application/vnd.apple.mpegurl')) {
359
+ video.src = videoSrc;
360
+ }
361
+ </script>
362
+ ```
363
+
364
+ #### Alternative setup
365
+
366
+ To check for native browser support first and then fallback to HLS.js, swap these conditionals. See [this comment](https://github.com/video-dev/hls.js/pull/2954#issuecomment-670021358) to understand some of the tradeoffs.
367
+
368
+ ```html
369
+ <script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
370
+ <!-- Or if you want a more recent alpha version -->
371
+ <!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@alpha"></script> -->
372
+ <video id="video"></video>
373
+ <script>
374
+ var video = document.getElementById('video');
375
+ var videoSrc = 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8';
376
+ //
377
+ // First check for native browser HLS support
378
+ //
379
+ if (video.canPlayType('application/vnd.apple.mpegurl')) {
380
+ video.src = videoSrc;
381
+ //
382
+ // If no native HLS support, check if HLS.js is supported
383
+ //
384
+ } else if (Hls.isSupported()) {
385
+ var hls = new Hls();
386
+ hls.loadSource(videoSrc);
387
+ hls.attachMedia(video);
388
+ }
389
+ </script>
390
+ ```
391
+
392
+ For more embed and API examples see [docs/API.md](./docs/API.md).
393
+
394
+ ## CORS
395
+
396
+ All HLS resources must be delivered with [CORS headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) permitting `GET` requests.
397
+
398
+ ## Video Control
399
+
400
+ Video is controlled through HTML `<video>` element `HTMLVideoElement` methods, events and optional UI controls (`<video controls>`).
401
+
402
+ ## Player Integration
403
+
404
+ The following players integrate HLS.js for HLS playback:
405
+
406
+ - [JW Player](https://www.jwplayer.com)
407
+ - [Akamai Adaptive Media Player (AMP)](https://www.akamai.com/us/en/solutions/products/media-delivery/adaptive-media-player.jsp)
408
+ - [Clappr](https://github.com/clappr/clappr)
409
+ - [Flowplayer](https://www.flowplayer.org) through [flowplayer-hlsjs](https://github.com/flowplayer/flowplayer-hlsjs)
410
+ - [MediaElement.js](https://www.mediaelementjs.com)
411
+ - [Videojs](https://videojs.com) through [Videojs-hlsjs](https://github.com/benjipott/videojs-hlsjs)
412
+ - [Videojs](https://videojs.com) through [videojs-hls.js](https://github.com/streamroot/videojs-hls.js). hls.js is integrated as a SourceHandler -- new feature in Video.js 5.
413
+ - [Videojs](https://videojs.com) through [videojs-contrib-hls.js](https://github.com/Peer5/videojs-contrib-hls.js). Production ready plug-in with full fallback compatibility built-in.
414
+ - [Fluid Player](https://www.fluidplayer.com)
415
+ - [OpenPlayerJS](https://www.openplayerjs.com), as part of the [OpenPlayer project](https://github.com/openplayerjs)
416
+ - [CDNBye](https://github.com/cdnbye/hlsjs-p2p-engine), a p2p engine for hls.js powered by WebRTC Datachannel.
417
+
418
+ ### They use HLS.js in production!
419
+
420
+ | | | | |
421
+ | :----------------------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
422
+ | [<img src="https://i.cdn.turner.com/adultswim/big/img/global/adultswim.jpg" width="120">](https://www.adultswim.com/streams) | [<img src="https://avatars3.githubusercontent.com/u/5497190?s=200&v=4" width="120">](https://www.akamai.com) | [<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/1a/Canal%2B.svg/2000px-Canal%2B.svg.png" width="120">](https://www.canalplus.fr) | [<img src="https://avatars2.githubusercontent.com/u/115313" width="120">](https://www.dailymotion.com) |
423
+ | [<img src="https://user-images.githubusercontent.com/4006693/44003595-baff193c-9e8f-11e8-9848-7bb91563499f.png" width="120">](https://freshlive.tv) | [<img src="https://flowplayer.org/media/img/logo-blue.png" width="120">](https://flowplayer.com) | [<img src="https://avatars1.githubusercontent.com/u/12554082?s=240" width="120">](https://www.foxsports.com.au) | [<img src="https://cloud.githubusercontent.com/assets/244265/12556435/dfaceb48-c353-11e5-971b-2c4429725469.png" width="120">](https://www.globo.com) |
424
+ | [<img src="https://images.gunosy.com/logo/gunosy_icon_company_logo.png" width="120">](https://gunosy.com) | [<img src="https://user-images.githubusercontent.com/1480052/35802840-f8e85b8a-0a71-11e8-8eb2-eee323e3f159.png" width="120">](https://www.gl-systemhaus.de/) | [<img src="https://cloud.githubusercontent.com/assets/6525783/20801836/700490de-b7ea-11e6-82bd-e249f91c7bae.jpg" width="120">](https://nettrek.de) | [<img src="https://cloud.githubusercontent.com/assets/244265/12556385/999aa884-c353-11e5-9102-79df54384498.png" width="120">](https://www.nytimes.com/) |
425
+ | [<img src="https://cloud.githubusercontent.com/assets/1798553/20356424/ba158574-ac24-11e6-95e1-1ae591b11a0a.png" width="120">](https://www.peer5.com/) | [<img src="https://cloud.githubusercontent.com/assets/4909096/20925062/e26e6fc8-bbb4-11e6-99a5-d4762274a342.png" width="120">](https://www.qbrick.com) | [<img src="https://www.radiantmediaplayer.com/images/radiantmediaplayer-new-logo-640.jpg" width="120">](https://www.radiantmediaplayer.com/) | [<img src="https://www.rts.ch/hummingbird-static/images/logos/logo_marts.svg" width="120">](https://www.rts.ch) |
426
+ | [<img src="https://cloud.githubusercontent.com/assets/12702747/19316434/0a3601de-9067-11e6-85e2-936b1cb099a0.png" width="120">](https://www.snapstream.com/) | [<img src="https://pamediagroup.com/wp-content/uploads/2019/05/StreamAMG-Logo-RGB.png" width="120">](https://www.streamamg.com/) | [<img src="https://streamsharkio.sa.metacdn.com/wp-content/uploads/2015/10/streamshark-dark.svg" width="120">](https://streamshark.io/) | [<img src="https://camo.githubusercontent.com/9580f10e9bfa8aa7fba52c5cb447bee0757e33da/68747470733a2f2f7777772e7461626c6f74762e636f6d2f7374617469632f696d616765732f7461626c6f5f6c6f676f2e706e67" width="120">](https://my.tablotv.com/) |
427
+ | [<img src="https://user-images.githubusercontent.com/2803310/34083705-349c8fd0-e375-11e7-92a6-5c38509f4936.png" width="120">](https://www.streamroot.io/) | [<img src="https://vignette1.wikia.nocookie.net/tedtalks/images/c/c0/TED_logo.png/revision/20150915192527" width="120">](https://www.ted.com/) | [<img src="https://www.seeklogo.net/wp-content/uploads/2014/12/twitter-logo-vector-download.jpg" width="120">](https://twitter.com/) | [<img src="https://player.clevercast.com/img/clevercast.png" width="120">](https://www.clevercast.com) |
428
+ | [<img src="https://player.mtvnservices.com/edge/hosted/Viacom_logo.svg" width="120">](https://www.viacom.com/) | [<img src="https://user-images.githubusercontent.com/1181974/29248959-efabc440-802d-11e7-8050-7c1f4ca6c607.png" width="120">](https://vk.com/) | [<img src="https://avatars0.githubusercontent.com/u/5090060?s=200&v=4" width="120">](https://www.jwplayer.com) | [<img src="https://staticftv-a.akamaihd.net/arches/francetv/default/img/og-image.jpg?20161007" width="120">](https://www.france.tv) |
429
+ | [<img src="https://showmax.akamaized.net/e/logo/showmax_black.png" width="120">](https://tech.showmax.com) | [<img src="https://static3.1tv.ru/assets/web/logo-ac67852f1625b338f9d1fb96be089d03557d50bfc5790d5f48dc56799f59dec6.svg" width="120" height="120">](https://www.1tv.ru/) | [<img src="https://user-images.githubusercontent.com/1480052/40482633-c013ebce-5f55-11e8-96d5-b776415de0ce.png" width="120">](https://www.zdf.de) | [<img src="https://github.com/cdnbye/hlsjs-p2p-engine/blob/master/figs/cdnbye.png" width="120">](https://github.com/cdnbye/hlsjs-p2p-engine) |
430
+ | [cdn77](https://streaming.cdn77.com/) | [<img src="https://avatars0.githubusercontent.com/u/7442371?s=200&v=4" width="120">](https://r7.com/) | [<img src="https://raw.githubusercontent.com/Novage/p2p-media-loader/gh-pages/images/p2pml-logo.png" width="120">](https://github.com/Novage/p2p-media-loader) | [<img src="https://avatars3.githubusercontent.com/u/45617200?s=400" width="120">](https://kayosports.com.au) |
431
+ | [<img src="https://avatars1.githubusercontent.com/u/5279615?s=400&u=9771a216836c613f1edf4afe71cfc69d4c5657ed&v=4" width="120">](https://flosports.tv) | [<img src="https://www.logolynx.com/images/logolynx/c6/c67a2cb3ad33a82b5518f8ad8f124703.png" width="120">](https://global.axon.com/) | | |
432
+
433
+ ## Chrome/Firefox integration
434
+
435
+ made by [gramk](https://github.com/gramk/chrome-hls), plays hls from address bar and m3u8 links
436
+
437
+ - Chrome [native-hls](https://chrome.google.com/webstore/detail/native-hls-playback/emnphkkblegpebimobpbekeedfgemhof)
438
+ - Firefox [native-hls](https://addons.mozilla.org/en-US/firefox/addon/native_hls_playback/)
439
+
440
+ ## License
441
+
442
+ HLS.js is released under [Apache 2.0 License](LICENSE)