myetv-player 1.0.0 → 1.0.8

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 (38) hide show
  1. package/.github/workflows/codeql.yml +100 -0
  2. package/README.md +49 -58
  3. package/SECURITY.md +50 -0
  4. package/css/myetv-player.css +424 -219
  5. package/css/myetv-player.min.css +1 -1
  6. package/dist/myetv-player.js +1759 -1502
  7. package/dist/myetv-player.min.js +1705 -1469
  8. package/package.json +7 -1
  9. package/plugins/README.md +1016 -0
  10. package/plugins/cloudflare/README.md +1068 -0
  11. package/plugins/cloudflare/myetv-player-cloudflare-stream-plugin.js +556 -0
  12. package/plugins/facebook/README.md +1024 -0
  13. package/plugins/facebook/myetv-player-facebook-plugin.js +437 -0
  14. package/plugins/gamepad-remote-controller/README.md +816 -0
  15. package/plugins/gamepad-remote-controller/myetv-player-gamepad-remote-plugin.js +678 -0
  16. package/plugins/google-adsense-ads/README.md +1 -0
  17. package/plugins/google-adsense-ads/g-adsense-ads-plugin.js +158 -0
  18. package/plugins/google-ima-ads/README.md +1 -0
  19. package/plugins/google-ima-ads/g-ima-ads-plugin.js +355 -0
  20. package/plugins/twitch/README.md +1185 -0
  21. package/plugins/twitch/myetv-player-twitch-plugin.js +569 -0
  22. package/plugins/vast-vpaid-ads/README.md +1 -0
  23. package/plugins/vast-vpaid-ads/vast-vpaid-ads-plugin.js +346 -0
  24. package/plugins/vimeo/README.md +1416 -0
  25. package/plugins/vimeo/myetv-player-vimeo.js +640 -0
  26. package/plugins/youtube/README.md +851 -0
  27. package/plugins/youtube/myetv-player-youtube-plugin.js +1714 -210
  28. package/scss/README.md +160 -0
  29. package/scss/_controls.scss +184 -30
  30. package/scss/_menus.scss +840 -672
  31. package/scss/_responsive.scss +67 -105
  32. package/scss/_volume.scss +67 -105
  33. package/src/README.md +559 -0
  34. package/src/controls.js +17 -5
  35. package/src/core.js +1237 -1060
  36. package/src/i18n.js +27 -1
  37. package/src/quality.js +478 -436
  38. package/src/subtitles.js +2 -2
@@ -0,0 +1,100 @@
1
+ # For most projects, this workflow file will not need changing; you simply need
2
+ # to commit it to your repository.
3
+ #
4
+ # You may wish to alter this file to override the set of languages analyzed,
5
+ # or to provide custom queries or build logic.
6
+ #
7
+ # ******** NOTE ********
8
+ # We have attempted to detect the languages in your repository. Please check
9
+ # the `language` matrix defined below to confirm you have the correct set of
10
+ # supported CodeQL languages.
11
+ #
12
+ name: "CodeQL Advanced"
13
+
14
+ on:
15
+ push:
16
+ branches: [ "main" ]
17
+ pull_request:
18
+ branches: [ "main" ]
19
+ schedule:
20
+ - cron: '29 21 * * 0'
21
+
22
+ jobs:
23
+ analyze:
24
+ name: Analyze (${{ matrix.language }})
25
+ # Runner size impacts CodeQL analysis time. To learn more, please see:
26
+ # - https://gh.io/recommended-hardware-resources-for-running-codeql
27
+ # - https://gh.io/supported-runners-and-hardware-resources
28
+ # - https://gh.io/using-larger-runners (GitHub.com only)
29
+ # Consider using larger runners or machines with greater resources for possible analysis time improvements.
30
+ runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
31
+ permissions:
32
+ # required for all workflows
33
+ security-events: write
34
+
35
+ # required to fetch internal or private CodeQL packs
36
+ packages: read
37
+
38
+ # only required for workflows in private repositories
39
+ actions: read
40
+ contents: read
41
+
42
+ strategy:
43
+ fail-fast: false
44
+ matrix:
45
+ include:
46
+ - language: actions
47
+ build-mode: none
48
+ - language: javascript-typescript
49
+ build-mode: none
50
+ # CodeQL supports the following values keywords for 'language': 'actions', 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'rust', 'swift'
51
+ # Use `c-cpp` to analyze code written in C, C++ or both
52
+ # Use 'java-kotlin' to analyze code written in Java, Kotlin or both
53
+ # Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
54
+ # To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
55
+ # see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
56
+ # If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
57
+ # your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
58
+ steps:
59
+ - name: Checkout repository
60
+ uses: actions/checkout@v4
61
+
62
+ # Add any setup steps before running the `github/codeql-action/init` action.
63
+ # This includes steps like installing compilers or runtimes (`actions/setup-node`
64
+ # or others). This is typically only required for manual builds.
65
+ # - name: Setup runtime (example)
66
+ # uses: actions/setup-example@v1
67
+
68
+ # Initializes the CodeQL tools for scanning.
69
+ - name: Initialize CodeQL
70
+ uses: github/codeql-action/init@v3
71
+ with:
72
+ languages: ${{ matrix.language }}
73
+ build-mode: ${{ matrix.build-mode }}
74
+ # If you wish to specify custom queries, you can do so here or in a config file.
75
+ # By default, queries listed here will override any specified in a config file.
76
+ # Prefix the list here with "+" to use these queries and those in the config file.
77
+
78
+ # For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
79
+ # queries: security-extended,security-and-quality
80
+
81
+ # If the analyze step fails for one of the languages you are analyzing with
82
+ # "We were unable to automatically build your code", modify the matrix above
83
+ # to set the build mode to "manual" for that language. Then modify this step
84
+ # to build your code.
85
+ # ℹ️ Command-line programs to run using the OS shell.
86
+ # 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
87
+ - if: matrix.build-mode == 'manual'
88
+ shell: bash
89
+ run: |
90
+ echo 'If you are using a "manual" build mode for one or more of the' \
91
+ 'languages you are analyzing, replace this with the commands to build' \
92
+ 'your code, for example:'
93
+ echo ' make bootstrap'
94
+ echo ' make release'
95
+ exit 1
96
+
97
+ - name: Perform CodeQL Analysis
98
+ uses: github/codeql-action/analyze@v3
99
+ with:
100
+ category: "/language:${{matrix.language}}"
package/README.md CHANGED
@@ -1,7 +1,31 @@
1
+ [![CodeQL Advanced](https://github.com/OskarCosimo/myetv-video-player-opensource/actions/workflows/codeql.yml/badge.svg)](https://github.com/OskarCosimo/myetv-video-player-opensource/actions/workflows/codeql.yml) [![Node.js Package](https://github.com/OskarCosimo/myetv-video-player-opensource/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/OskarCosimo/myetv-video-player-opensource/actions/workflows/npm-publish.yml)
2
+
1
3
  # MYETV Audio/Video Player Open Source
2
4
 
3
5
  A modern and complete HTML5 + JavaScript + css video player with custom controls, multiple quality support, subtitles, Picture-in-Picture and much more.
4
6
 
7
+ ## Table of Contents
8
+
9
+ - [Features](#features)
10
+ - [Demo Page](#demo-page)
11
+ - [Installation](#installation)
12
+ - [Basic Usage](#basic-usage)
13
+ - [Initialization Options](#initialization-options)
14
+ - [Api Methods](#api-methods)
15
+ - [Api Events](#api-events)
16
+ - [Keyboard Controls](#keyboard-controls)
17
+ - [CSS Customization](#css-customization)
18
+ - [Browser Compatibility](#browser-compatibility)
19
+ - [Plugins Feature](#plugins-feature)
20
+ - [Chapters Feature](#chapters-feature)
21
+ - [Playlist Feature](#playlist-feature)
22
+ - [Adaptive Streaming (HLS/DASH)](#adaptive-streaming-hlsdash)
23
+ - [Supported Browsers](#supported-browsers)
24
+ - [License](#license)
25
+ - [Contributing](#contributing)
26
+
27
+ ---
28
+
5
29
  ## Features
6
30
 
7
31
  - **Custom controls** with intelligent auto-hide
@@ -75,8 +99,9 @@ const player = new MYETVvideoplayer('my-video', {
75
99
  | `subtitlesEnabled` | boolean | `false` | Enable/Disable subtitles at player ready |
76
100
  | `chapters` | string | json | Enable/Disable chapters: chapter can be in json format or string format (see below) |
77
101
  | `plugins` | string | json | Add a customized plugin to the player to extend its functionality (see below) |
102
+ | `seekHandleShape` | string | `true` | Edit the shape of the seek controlbar. Shape type: none, circle, square, diamond, arrow, triangle, heart, star |
78
103
  | `showSeekTooltip` | boolean | `true` | Show tooltip during seek |
79
- | `volumeSlider` | string | `horizontal` | Volume slider 'horizontal' or 'vertical': the horizontal slider is always visible and have the automatic fallback to vertical under 550px of width; the vertical slider is only vertical at any width and automatically disapper if mouse is not hover the volume button |
104
+ | `volumeSlider` | string | `show` | Volume slider 'show' or 'hide': with "show" the volume slider is always visible and have the automatic fallback to "hide" under 550px of width; with "hide" the volume slider is visible only at mouse over |
80
105
  | `autoplay` | boolean | `false` | Start video automatically |
81
106
  | `loop` | boolean | `false` | Optional if the video should loop
82
107
  | `resolution` | string | `normal` | resolution type: "normal" same resolution of the native video; "4:3"; "16:9"; "stretched" the video will be stretched in all the container; "fit-to-screen" the video will fit the screen but can be cutted; "scale-to-fit" fit the screen but preserve aspect ration and not cut |
@@ -188,26 +213,7 @@ player.setChapters([...]);
188
213
  player.clearChapters();
189
214
  ```
190
215
  ### Plugins Controls
191
- ```
192
- // Add plugins dynamically
193
- player.usePlugin('youtube', {
194
- apiKey: 'your-api-key'
195
- });
196
-
197
- // Upload YouTube videos (based on the YouTube plugin example)
198
- player.loadYouTubeVideo('dQw4w9WgXcQ');
199
-
200
- // Check if a plugin is active
201
- if (player.hasPlugin('youtube')) {
202
- console.log('YouTube plugin is active');
203
- }
204
-
205
- // Get plugin instance
206
- const youtubePlugin = player.getPlugin('youtube');
207
-
208
- // Remove plugins from the player
209
- player.removePlugin('youtube');
210
- ```
216
+ [Plugins Help: https://github.com/OskarCosimo/myetv-video-player-opensource/blob/main/plugins/README.md](https://github.com/OskarCosimo/myetv-video-player-opensource/blob/main/plugins/README.md)
211
217
  ### Screen Controls
212
218
  ```
213
219
  // Fullscreen and Picture-in-Picture
@@ -218,7 +224,7 @@ player.togglePictureInPicture(); // Toggle Picture-in-Picture
218
224
  ```
219
225
  ### Brand Logo Controls
220
226
  ```
221
- // Fullscreen and Picture-in-Picture
227
+ // Brand Logo in controlbar
222
228
  player.setBrandLogo(enabled, url, linkUrl) //change brand logo dynamically
223
229
  player.getBrandLogoSettings() //get current brand logo settings
224
230
  ```
@@ -245,6 +251,18 @@ player.removeWatermark();
245
251
  //hide with the controlbar or always show the watermark logo
246
252
  player.setWatermarkAutoHide(false);
247
253
  ```
254
+ ### Controlbar seek shape
255
+ ```
256
+ // Change dynamically
257
+ player.setSeekHandleShape('heart');
258
+
259
+ // Get the current shape
260
+ console.log(player.getSeekHandleShape()); // "heart"
261
+
262
+ // Show all available shape
263
+ console.log(player.getAvailableSeekHandleShapes());
264
+ // ["none", "circle", "square", "diamond", "arrow", "triangle", "heart", "star"]
265
+ ```
248
266
  ### Playlist Controls
249
267
  ```
250
268
  player.nextVideo(); // Next Video
@@ -728,43 +746,10 @@ Minimal DOM manipulation thanks to CSS-based theming
728
746
 
729
747
  Hardware-accelerated transitions for smooth playback
730
748
 
731
- ## Plguins feature
749
+ ## Plugins feature
732
750
  The player supports custom plugins to extend its functionality. Every plugins must have its own documentation to clearly known how to use it. Plugins are modular so you can add or remove any plugins whenever you want. This is just an example based on two plugins.
733
- ### Add a plguin to the player
734
- ```
735
- <!-- Google Analytics 4 -->
736
- <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
737
- <script>
738
- window.dataLayer = window.dataLayer || [];
739
- function gtag(){dataLayer.push(arguments);}
740
- gtag('js', new Date());
741
- gtag('config', 'G-XXXXXXXXXX');
742
- </script>
743
- <!-- Player bundle -->
744
- <script src="dist/myetv-player.min.js"></script>
745
- <!-- Plugin bundle -->
746
- <script src="plugins/youtube/myetv-player-youtube-plugin.js"></script>
747
- <script src="plugins/google-analytics/myetv-player-g-analytics-plugin.js"></script>
748
- ```
749
- ### Initialization exmples with plugins
750
- ```
751
- const player = new MYETVPlayer('my-video', {
752
- debug: true,
753
- plugins: {
754
- youtube: {
755
- videoId: 'dQw4w9WgXcQ', // Video ID of YouTube (example)
756
- apiKey: 'your-api-key',
757
- autoplay: false
758
- },
759
- analytics: {
760
- platform: 'ga4',
761
- videoTitle: 'My Awesome Video',
762
- videoCategory: 'Tutorial',
763
- videoId: 'video-001'
764
- }
765
- }
766
- });
767
- ```
751
+
752
+ [Plugins and Feature Help: https://github.com/OskarCosimo/myetv-video-player-opensource/tree/main/plugins](https://github.com/OskarCosimo/myetv-video-player-opensource/tree/main/plugins)
768
753
 
769
754
  ## Chapters feature
770
755
  Supports flexible time formats (HH:MM:SS, MM:SS, or seconds) and images url (optional)
@@ -862,5 +847,11 @@ Push to the branch (git push origin feature/feature-name)
862
847
 
863
848
  Create a Pull Request
864
849
 
850
+ Contact MYETV here: [https://support.myetv.tv](https://support.myetv.tv)
851
+
852
+ Donate to the project here: [https://blog.myetv.tv/donate-to-developers/](https://blog.myetv.tv/donate-to-developers/)
853
+
854
+ Watch MYETV here: [https://www.myetv.tv](https://www.myetv.tv)
855
+
865
856
  ## Bug Reports
866
857
  To report bugs or request features, open an issue in the repository.
package/SECURITY.md ADDED
@@ -0,0 +1,50 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ Use this section to tell people about which versions of your project are
6
+ currently being supported with security updates.
7
+
8
+ | Version | Supported |
9
+ | ------- | ------------------ |
10
+ | 1.x.x | :white_check_mark: |
11
+
12
+ ## Reporting a Vulnerability
13
+
14
+ We take the security of MYETV Video Player seriously. If you discover a security vulnerability, please report it responsibly.
15
+
16
+ ### How to Report
17
+
18
+ **Please do not report security vulnerabilities through public GitHub issues.**
19
+
20
+ Instead, please report them via one of the following methods:
21
+ - The best way is: open a ticket here: [https://support.myetv.tv](https://support.myetv.tv)
22
+ - Use GitHub's private vulnerability reporting feature in the Security tab of this repository
23
+ - Email: admin@myetv.tv (This method is susceptible to email provider security like spam or otherwise)
24
+
25
+ ### What to Include
26
+
27
+ To help us better understand and resolve the issue, please include:
28
+ - A clear description of the vulnerability
29
+ - Steps to reproduce the issue
30
+ - Affected versions of MYETV Video Player
31
+ - Potential impact and severity assessment
32
+ - Any suggested fixes or patches (if available)
33
+ - Your environment details (browser, OS, etc.)
34
+
35
+ ### Response Timeline
36
+
37
+ - **Acknowledgment:** We will confirm receipt of your report within **48 hours**
38
+ - **Initial Assessment:** We will provide an initial evaluation within **7 days**
39
+ - **Progress Updates:** We will keep you informed about the progress of resolving the issue
40
+ - **Resolution:** Once a fix is developed, we will coordinate the release and disclosure timeline with you
41
+
42
+ ### Disclosure Policy
43
+
44
+ We follow responsible disclosure principles:
45
+ - Please allow us reasonable time to investigate and fix the vulnerability before public disclosure
46
+ - We will credit you in the security advisory (unless you prefer to remain anonymous)
47
+ - Once the fix is released, we will publish a security advisory with details about the vulnerability
48
+ - We appreciate your cooperation in keeping MYETV users safe
49
+
50
+ Thank you for helping to keep MYETV Video Player secure!