@mdcrtrs/player 0.1.3
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.
- package/LICENSE +51 -0
- package/README.md +77 -0
- package/dist/index.cjs +667 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +87 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +628 -0
- package/dist/index.js.map +1 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
MediaCreators "MOS ONE" License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 MediaCreators. All rights reserved.
|
|
4
|
+
|
|
5
|
+
PROPRIETARY SOFTWARE LICENSE
|
|
6
|
+
|
|
7
|
+
This software and associated documentation files (the "Software") are the proprietary
|
|
8
|
+
and confidential property of MediaCreators ("Company"). This Software is protected by
|
|
9
|
+
copyright laws and international copyright treaties, as well as other intellectual
|
|
10
|
+
property laws and treaties.
|
|
11
|
+
|
|
12
|
+
RESTRICTIONS:
|
|
13
|
+
|
|
14
|
+
1. The Software is licensed, not sold. You may not use, copy, modify, distribute,
|
|
15
|
+
sell, or transfer the Software or any portion thereof without express written
|
|
16
|
+
permission from MediaCreators.
|
|
17
|
+
|
|
18
|
+
2. You may not reverse engineer, decompile, disassemble, or otherwise attempt to
|
|
19
|
+
derive the source code of the Software.
|
|
20
|
+
|
|
21
|
+
3. You may not remove, alter, or obscure any proprietary notices (including copyright
|
|
22
|
+
and trademark notices) that may be affixed to or contained within the Software.
|
|
23
|
+
|
|
24
|
+
4. This Software may only be used by authorized personnel of MediaCreators or its
|
|
25
|
+
affiliated entities for business purposes directly related to MediaCreators'
|
|
26
|
+
operations.
|
|
27
|
+
|
|
28
|
+
AUTHORIZED USE:
|
|
29
|
+
|
|
30
|
+
- Employees and contractors of MediaCreators may use this Software for development,
|
|
31
|
+
testing, and production purposes as part of their work responsibilities.
|
|
32
|
+
- Access to this Software implies acceptance of these license terms.
|
|
33
|
+
|
|
34
|
+
DISCLAIMER:
|
|
35
|
+
|
|
36
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
37
|
+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
|
38
|
+
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL MEDIACREATORS BE LIABLE
|
|
39
|
+
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
|
40
|
+
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
|
41
|
+
OR OTHER DEALINGS IN THE SOFTWARE.
|
|
42
|
+
|
|
43
|
+
CONTACT:
|
|
44
|
+
|
|
45
|
+
For licensing inquiries or permissions, contact:
|
|
46
|
+
MediaCreators
|
|
47
|
+
Email: legal@mediacreators.io
|
|
48
|
+
Website: https://mediacreators.io
|
|
49
|
+
|
|
50
|
+
This license is effective as of the date of first use and remains in effect until
|
|
51
|
+
terminated by MediaCreators.
|
package/README.md
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# @mdcrtrs/player
|
|
2
|
+
|
|
3
|
+
Video player SDK for [MediaCreators](https://mediacreators.io) Streaming Community frontends. Drop-in React component with signed playback, theming, volume persistence, and optional watch progress tracking.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @mdcrtrs/player
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Requires `react` and `react-dom` >= 18 as peer dependencies.
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { MediaCreatorsPlayer } from "@mdcrtrs/player"
|
|
17
|
+
|
|
18
|
+
function VideoPlayer() {
|
|
19
|
+
return (
|
|
20
|
+
<MediaCreatorsPlayer
|
|
21
|
+
creatorId="your-project-public-id"
|
|
22
|
+
asset={{
|
|
23
|
+
assetId: "asset-id",
|
|
24
|
+
playbackId: "playback-id",
|
|
25
|
+
title: "Episode 1",
|
|
26
|
+
}}
|
|
27
|
+
theme={{ primaryColor: "#6366F1" }}
|
|
28
|
+
onPlay={(currentTime) => console.log("Playing at", currentTime)}
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### With fan authentication and watch progress
|
|
35
|
+
|
|
36
|
+
```tsx
|
|
37
|
+
<MediaCreatorsPlayer
|
|
38
|
+
creatorId="your-project-public-id"
|
|
39
|
+
asset={asset}
|
|
40
|
+
auth={{ fanToken: "fan-session-token" }}
|
|
41
|
+
autoResume
|
|
42
|
+
onTimeUpdate={(currentTime, duration, pct) => {}}
|
|
43
|
+
onQuartile={(q) => console.log(`Reached ${q}%`)}
|
|
44
|
+
onComplete={() => console.log("Done")}
|
|
45
|
+
/>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Props
|
|
49
|
+
|
|
50
|
+
| Prop | Type | Required | Description |
|
|
51
|
+
|------|------|----------|-------------|
|
|
52
|
+
| `creatorId` | `string` | Yes | Project public ID |
|
|
53
|
+
| `asset` | `PlayerAsset` | Yes | Asset to play (`assetId`, `playbackId`, `title`, optional `duration`) |
|
|
54
|
+
| `auth` | `{ fanToken: string }` | No | Fan authentication for personalized features |
|
|
55
|
+
| `theme` | `{ primaryColor: string }` | No | Brand color (CSS color value) |
|
|
56
|
+
| `playerTheme` | `string` | No | Player chrome theme name |
|
|
57
|
+
| `poster` | `string` | No | Poster image URL |
|
|
58
|
+
| `autoResume` | `boolean` | No | Resume from last watched position (requires `auth`) |
|
|
59
|
+
| `className` | `string` | No | CSS class for the player container |
|
|
60
|
+
|
|
61
|
+
### Events
|
|
62
|
+
|
|
63
|
+
| Event | Signature | Description |
|
|
64
|
+
|-------|-----------|-------------|
|
|
65
|
+
| `onReady` | `() => void` | Player is ready |
|
|
66
|
+
| `onPlay` | `(currentTime: number) => void` | Playback started |
|
|
67
|
+
| `onPause` | `(currentTime: number) => void` | Playback paused |
|
|
68
|
+
| `onTimeUpdate` | `(currentTime, duration, pct) => void` | Periodic time update |
|
|
69
|
+
| `onQuartile` | `(quartile: 25 \| 50 \| 75 \| 100) => void` | Playback quartile reached |
|
|
70
|
+
| `onSeeked` | `(from: number, to: number) => void` | User seeked |
|
|
71
|
+
| `onComplete` | `() => void` | Playback completed |
|
|
72
|
+
| `onResume` | `(position: number) => void` | Resumed from saved position |
|
|
73
|
+
| `onError` | `(error: { code: string, message: string }) => void` | Playback error |
|
|
74
|
+
|
|
75
|
+
## License
|
|
76
|
+
|
|
77
|
+
Proprietary - MediaCreators
|