@cinecrew/cinecrew-player 0.1.1 → 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/README.md CHANGED
@@ -24,7 +24,7 @@
24
24
 
25
25
  <p align="center"><strong>🎬 Movies</strong> &nbsp; <strong>📡 Live TV</strong> &nbsp; <strong>📱 Native</strong> &nbsp; <strong>🖥️ Web & Electron</strong></p>
26
26
 
27
- | **2 player components** | **5 target environments** | **16 visibility controls** | **20 action hooks** |
27
+ | **2 player components** | **5 target environments** | **15 visibility controls** | **19 action hooks** |
28
28
  |:---:|:---:|:---:|:---:|
29
29
  | Full player + inline live preview | Web · Electron · Android · iOS · React Native Web | Choose what appears | Override default actions |
30
30
 
@@ -53,14 +53,14 @@ flowchart LR
53
53
  | Area | Included capabilities | Designed for |
54
54
  |---|---|---|
55
55
  | 🎞️ **Playback** | On-demand and live media; URLs and local URIs; HLS and MPEG-TS paths on web; native VLC path; embedded YouTube playback | Movies, episodes, trailers, and channels |
56
- | 🎛️ **Player controls** | Play/pause, seek, restart, mute, aspect ratio, lock, video-only/audio-only modes, audio tracks, playback speed, fullscreen, back, minimize | A complete control surface without hard-wiring your app navigation |
56
+ | 🎛️ **Player controls** | Play/pause, seek, restart, mute, aspect ratio, lock, video-only/audio-only modes, audio tracks, playback speed, fullscreen, back | A complete control surface without hard-wiring your app navigation |
57
57
  | 🎨 **Branding** | Theme colors, radius, platform styles, replaceable icons, custom panel render slots | Match your app without forking the player |
58
58
  | 📡 **Live TV extensions** | Inline preview component; optional chat and EPG panels; recording adapter hooks | Channel browsing and live-viewing workflows |
59
59
  | 🔌 **App integration** | Per-action callbacks, imperative ref API, source resolver, progress/presence/events hooks, sleep timer callback | Keep account, IPTV, analytics, and storage logic in your app |
60
60
  | 🧭 **Playback lifecycle** | Ready, playing, buffering, progress, ended, error, fullscreen, next-episode, and playback-route callbacks | App-owned navigation, telemetry, and resume state |
61
61
 
62
62
  <details>
63
- <summary><strong>🎛️ Control inventory — all 16 visibility switches</strong></summary>
63
+ <summary><strong>🎛️ Control inventory — all 15 visibility switches</strong></summary>
64
64
 
65
65
  | Icon | `controls` key | What it controls | Notes |
66
66
  |:---:|---|---|---|
@@ -74,7 +74,6 @@ flowchart LR
74
74
  | 🎧 | `audioOnly` | Audio-only presentation | Playback continues behind the audio card |
75
75
  | 🎚️ | `audioTracks` | Audio-track selection | Depends on exposed tracks / platform engine |
76
76
  | ⏩ | `playbackRate` | Playback speed | On-demand experience |
77
- | ⤵️ | `minimize` | Minimize action | App supplies its navigation or sheet behavior |
78
77
  | ⛶ | `fullscreen` | Fullscreen / promote preview | Native full-player presentation is platform-specific |
79
78
  | ⏺️ | `recording` | Recording controls | Requires an app recording adapter or callback |
80
79
  | 💬 | `liveChat` | Live chat panel | Requires an adapter, render slot, or callback |
@@ -91,7 +90,7 @@ flowchart LR
91
90
  | 🎨 Colors and shape | `theme`: accent, background, control, surface, error colors, border radius, and native palette |
92
91
  | 🪄 Icons | `icons`: provide a glyph/string, React node, or icon component; omitted icons keep CineCrew defaults |
93
92
  | 🧠 Per-control behavior | `actions`: override only the actions your app wants to own; built-in behavior remains the default otherwise |
94
- | 🧱 App-owned panels | `renderLiveChat`, `renderEpg`, or integration render callbacks |
93
+ | 🧱 Chat and EPG drawers | `drawerMode`, `drawerStyle`, and optional app-owned `renderLiveChat` / `renderEpg` views |
95
94
  | 🔗 Source handling | `resolveSource` for share pages or host-specific resolution; direct media sources pass through unchanged |
96
95
  | 📐 Layout | `style`, web `className`, inline preview geometry, and `InlineLivePlayer` height |
97
96
  | 📣 Events and state | Lifecycle callbacks plus progress, presence, analytics, and sleep-timer integrations |
@@ -165,7 +164,7 @@ The items below are planned for more consistent, user-facing support across plat
165
164
  - **[Expo / React Native Web demo](examples/expo-web-demo)** — the same source tests and controls in an Expo app rendered for the web.
166
165
  - **[Android and iOS Expo Snack demos](examples/snack/App.js)** — both platform links load the same five-test native playground (YouTube, `.ts`, `.mp4`, `.mkv`, and local-file upload), with full-player and inline-player modes. Snack runs in Expo Go, which cannot load this package's custom VLC module; MPEG-TS and MKV playback should be tested in a native development build. [Expo documents this Expo Go limitation](https://docs.expo.dev/faq/#what-can-i-do-or-cannot-do-with-expo-go).
167
166
 
168
- The React/Vite and Expo Web demos use the single package in this repository (`file:../..`) so they can build before and after the public release. Snack loads the native example from this repository's `main` branch and installs `@cinecrew/cinecrew-player` from npm, so those links become runnable once the example is pushed and the package is published. The React DOM entry resolves to the browser renderer; it does not evaluate React Native or VLC code. The Expo native entry bundles VLC into the same installed package. External media hosts must allow browser CORS requests; format/codec support also depends on the browser. MKV playback is generally more reliable through the native VLC adapter than a browser video element.
167
+ The React/Vite demo is self-contained and installs the released `@cinecrew/cinecrew-player` package, so its StackBlitz link works from the `examples/web-demo` subdirectory. Its MPEG-TS button uses a small same-origin H.264/AAC fixture to exercise the TS parser without relying on an external server's CORS configuration. The Expo Web demo uses this repository's package source (`file:../..`) so contributors can test unreleased changes locally. Snack loads the native example from this repository's `main` branch and installs `@cinecrew/cinecrew-player` from npm. The React DOM entry resolves to the browser renderer; it does not evaluate React Native or VLC code. The Expo native entry bundles VLC into the same installed package. External media hosts must allow browser CORS requests; format/codec support also depends on the browser. MKV playback is generally more reliable through the native VLC adapter than a browser video element.
169
168
 
170
169
  Run either demo:
171
170
 
@@ -345,8 +344,12 @@ In short: CineCrew’s intended distinction is **one app-facing player package f
345
344
  | `volume` | `number` | `1` | Initial volume from `0` to `1`. |
346
345
  | `playbackRate` | `number` | `1` | Initial playback speed; the on-demand speed control can change it afterward. |
347
346
  | `controls` | `PlayerControls` | defaults below | Show/hide individual control buttons. |
347
+ | `features` | feature flags | `{}` | Optional player features, including web stream diagnostics with `{ diagnostics: true }`. |
348
348
  | `actions` | `PlayerActions` | `{}` | Replace the built-in behavior for individual actions. If a callback is provided, that callback owns the action. |
349
349
  | `integrations` | `PlayerIntegrations` | `{}` | Inject user identity, chat, EPG, recording, analytics, and presence services. |
350
+ | `drawerMode` | `'overlay' \| 'resize'` | `'overlay'` | Web/Electron drawer behavior: overlay the video or resize it to make room for chat, EPG, and diagnostics. |
351
+ | `drawerStyle` | `React.CSSProperties` / React Native `ViewStyle` | — | Platform-specific style overrides for the chat, EPG, and diagnostics drawer. |
352
+ | `messagePageSize` | `number` | `50` | Number of live-chat messages fetched per page; older pages load from the drawer’s “See more” control. |
350
353
  | `theme` | `PlayerTheme` | built-in theme | Customize player colors, borders, and shape. |
351
354
  | `icons` | `PlayerIcons` | built-in icons | Override any control icon by key. |
352
355
  | `style` | platform style | — | Outer player style. On web this is a CSS style object; native uses React Native style props. |
@@ -361,14 +364,14 @@ In short: CineCrew’s intended distinction is **one app-facing player package f
361
364
  | `mediaId`, `episodeLabel`, `season`, `episode`, `genre`, `categoryName` | metadata | — | Optional item metadata for the player and integrations. |
362
365
  | `playlist` | `object[]` | — | Episode list used for automatic next-episode behavior. |
363
366
  | `shuffle` | `boolean` | `false` | Select a random next episode when the current episode ends. |
364
- | `onClose`, `onBack`, `onMinimize` | callbacks | — | Player lifecycle/navigation callbacks. |
367
+ | `onClose`, `onBack` | callbacks | — | Player lifecycle/navigation callbacks. |
365
368
  | `onReady`, `onProgress`, `onPlaying`, `onBuffering`, `onError`, `onEnded`, `onPlaybackRoute` | callbacks | — | Playback lifecycle callbacks. Progress payloads are platform-specific native/browser events. |
366
369
  | `onNextEpisode`, `onCwRefresh` | callbacks | — | Episode advancement and post-close refresh hooks. |
367
370
  | `renderLiveChat`, `renderEpg` | render functions | — | Web custom-panel render slots. On native, use the chat/EPG integration adapters. |
368
371
  | `initialShowLiveChat`, `liveChatNonce` | `boolean`, `number` | `false`, `0` | Open or re-open the live-chat panel (when available). |
369
372
  | `inlinePreview`, `inlinePreviewRect`, `onInlinePreviewWheel`, `onPromotePreview`, `onPlayerHostRef` | preview options and callbacks | — | Embed/manage the player as a movable inline preview. Mainly useful for app-level player shells. |
370
373
 
371
- `features` can enable optional diagnostics with `{ diagnostics: true }`. `onFullscreen` receives `{ isFullscreen }`. All lifecycle callbacks in the table are optional; native event objects differ from browser events.
374
+ `features={{ diagnostics: true }}` enables the diagnostics button and built-in stream status panel on web; `controls.diagnostics` can hide it and `actions.onDiagnosticsOpen` can replace the panel action. `onFullscreen` receives `{ isFullscreen }`. All lifecycle callbacks in the table are optional; native event objects differ from browser events.
372
375
 
373
376
  ### Player source
374
377
 
@@ -426,11 +429,11 @@ Every control can be hidden with `false`. Defaults are designed to be useful out
426
429
  audioOnly: true,
427
430
  audioTracks: true,
428
431
  playbackRate: true,
429
- minimize: false,
430
432
  fullscreen: true,
431
433
  recording: false,
432
434
  liveChat: false,
433
435
  epg: false,
436
+ diagnostics: true,
434
437
  seek: true,
435
438
  }}
436
439
  />
@@ -448,11 +451,11 @@ Every control can be hidden with `false`. Defaults are designed to be useful out
448
451
  | `audioOnly` | Show the audio-only card while playback continues. |
449
452
  | `audioTracks` | Audio-track picker when tracks are exposed. |
450
453
  | `playbackRate` | On-demand playback speed. |
451
- | `minimize` | Minimize callback button; hidden unless enabled. |
452
454
  | `fullscreen` | Fullscreen button on web and inline previews. Native player opens full-screen. |
453
455
  | `recording` | Recording controls; requires `integrations.recording` or an action override. |
454
456
  | `liveChat` | Chat drawer/panel; requires a chat adapter, render slot, or action override. |
455
457
  | `epg` | EPG drawer/panel; requires an EPG adapter, render slot, or action override. |
458
+ | `diagnostics` | Stream diagnostics button; enable with `features={{ diagnostics: true }}` or provide `actions.onDiagnosticsOpen`. |
456
459
  | `seek` | On-demand seek bar. |
457
460
 
458
461
  ## Actions and callbacks
@@ -467,7 +470,6 @@ const playerRef = React.useRef(null);
467
470
  source={source}
468
471
  actions={{
469
472
  onRestart: (_payload, { player }) => player?.restart(),
470
- onMinimize: () => closePlayerSheet(),
471
473
  onBack: () => navigation.goBack(),
472
474
  onMute: ({ muted }, { player }) => player?.setMuted(muted),
473
475
  onAspectRatioChange: ({ aspectRatio }, { player }) => player?.setAspectRatio(aspectRatio),
@@ -475,9 +477,9 @@ const playerRef = React.useRef(null);
475
477
  />
476
478
  ```
477
479
 
478
- Available action keys: `onBack`, `onPlayPause`, `onSeek`, `onRestart`, `onLock`, `onMute`, `onAspectRatioChange`, `onVideoOnlyChange`, `onAudioOnlyChange`, `onAudioTrackChange`, `onMinimize`, `onPlaybackRateChange`, `onFullscreen`, `onRecordingStart`, `onRecordingPause`, `onRecordingResume`, `onRecordingStop`, `onLiveChatOpen`, `onEpgOpen`, and `onDiagnosticsOpen`.
480
+ Available action keys: `onBack`, `onPlayPause`, `onSeek`, `onRestart`, `onLock`, `onMute`, `onAspectRatioChange`, `onVideoOnlyChange`, `onAudioOnlyChange`, `onAudioTrackChange`, `onPlaybackRateChange`, `onFullscreen`, `onRecordingStart`, `onRecordingPause`, `onRecordingResume`, `onRecordingStop`, `onLiveChatOpen`, `onEpgOpen`, and `onDiagnosticsOpen`.
479
481
 
480
- The ref exposes `play`, `pause`, `togglePlayPause`, `restart`, `setMuted`, `toggleMute`, `setAspectRatio`, `setAudioTrack`, `setAudioOnly`, `setVideoOnly`, `setPlaybackRate`, `seekTo`, `seekBy`, `back`, `minimize`, `getVideoElement`, `getAudioTracks`, and fullscreen methods where supported.
482
+ The ref exposes `play`, `pause`, `togglePlayPause`, `restart`, `setMuted`, `toggleMute`, `setAspectRatio`, `setAudioTrack`, `setAudioOnly`, `setVideoOnly`, `setPlaybackRate`, `seekTo`, `seekBy`, `back`, `getVideoElement`, `getAudioTracks`, and fullscreen methods where supported.
481
483
 
482
484
  ## Integrations
483
485
 
@@ -491,7 +493,7 @@ Integrations are optional. The package has no CineCrew account, database, or wor
491
493
  user: { id: currentUser.id, username: currentUser.name },
492
494
  liveChat: {
493
495
  pollIntervalMs: 5000,
494
- loadMessages: ({ channelId, limit }) => api.loadChat(channelId, limit),
496
+ loadMessages: ({ channelId, limit, offset }) => api.loadChat(channelId, { limit, offset }),
495
497
  sendMessage: ({ channelId, userId, username, comment }) =>
496
498
  api.sendChat({ channelId, userId, username, comment }),
497
499
  },
@@ -515,7 +517,9 @@ Integrations are optional. The package has no CineCrew account, database, or wor
515
517
  />
516
518
  ```
517
519
 
518
- `loadMessages` returns an array of messages with `username` and `comment` (or `message`) fields. `loadListings` returns EPG entries with `startMs` and `endMs` epoch-millisecond timestamps. The native player renders the built-in chat and EPG UI from these adapters. On web, an app can use `renderLiveChat` / `renderEpg`, or provide `integrations.liveChat.render` / `integrations.epg.render`.
520
+ On web and Electron, the player supplies the chat drawer UI—including the composer and emoji picker—when `integrations.liveChat.loadMessages` is provided. `sendMessage` connects the built-in composer to your chat service; omit it to show a read-only chat. Messages may include `id`, `username`, `comment` (or `message`), and `timestamp` (or `createdAt`). The drawer requests the newest page with `offset: 0`, then requests older pages with the same `limit` and an increasing `offset` when “See more messages” is selected. Return each page in chronological order (oldest first); return `{ messages, hasMore }` when your service can report whether older pages exist. Otherwise, a full page implies there may be more. Live chat polls for new messages at `pollIntervalMs` (defaults to five seconds).
521
+
522
+ The EPG drawer uses `integrations.epg.loadListings`, which returns entries with `startMs` and `endMs` epoch-millisecond timestamps. Both drawers default to a semi-transparent right-side overlay, so video size does not change. Set `drawerMode="resize"` to reserve space and shrink the video; customize the drawer with `drawerStyle`. You may supply `renderLiveChat` / `renderEpg` or integration render callbacks to replace the built-in drawer contents. The native player renders its platform-native chat and EPG UI from the same adapters.
519
523
 
520
524
  ## Themes and icons
521
525
 
@@ -540,7 +544,7 @@ Defaults are used unless the caller supplies an override. Web theme properties i
540
544
  />
541
545
  ```
542
546
 
543
- Icon keys: `play`, `pause`, `restart`, `lock`, `unlock`, `mute`, `unmute`, `aspectRatio`, `videoOnly`, `audio`, `minimize`, `back`, `recording`, `stop`, `liveChat`, `epg`, `fullscreen`, and `close`. A value may be a string/glyph, a React element, or an icon component.
547
+ Icon keys: `play`, `pause`, `restart`, `lock`, `unlock`, `mute`, `unmute`, `aspectRatio`, `videoOnly`, `audio`, `back`, `recording`, `stop`, `liveChat`, `epg`, `fullscreen`, and `close`. A value may be a string/glyph, a React element, or an icon component.
544
548
 
545
549
  ## Sources and link resolution
546
550
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cinecrew/cinecrew-player",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "type": "module",
5
5
  "description": "Customizable cross-platform live and on-demand video player for React and React Native.",
6
6
  "license": "MIT",
@@ -106,7 +106,6 @@
106
106
  },
107
107
  "dependencies": {
108
108
  "@expo/vector-icons": "^15.1.1",
109
- "@hiraku-ai/react-native-emoji-picker": "^1.2.4",
110
109
  "@mediabunny/ac3": "^1.59.0",
111
110
  "@react-native-community/slider": "^5.2.0",
112
111
  "expo-video": "^57.0.2",
@@ -0,0 +1,5 @@
1
+ # Emoji data
2
+
3
+ `emoji-data.json` is sourced from the [`stdlib-js/datasets-emoji` dataset](https://github.com/stdlib-js/datasets-emoji/blob/main/data/data.json).
4
+
5
+ The upstream repository states that its database contents are licensed under CC0 1.0 Universal (and PDDL 1.0); this project uses the emoji data only. The file is bundled locally so the picker works offline and groups entries by the dataset's Unicode emoji group names.