branch-video-player-sdk 0.2.8 → 0.2.10
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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# BranchVideo Player SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`branch-video-player-sdk` embeds a static BranchVideo Runtime in an iframe.
|
|
4
4
|
|
|
5
5
|
```ts
|
|
6
|
-
import { createBranchVideoPlayer } from '
|
|
6
|
+
import { createBranchVideoPlayer } from 'branch-video-player-sdk'
|
|
7
7
|
|
|
8
8
|
const player = createBranchVideoPlayer({
|
|
9
9
|
container: '#player',
|
|
@@ -13,12 +13,12 @@ const player = createBranchVideoPlayer({
|
|
|
13
13
|
player.on('ended', (result) => saveProgress(result))
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
The ESM entry is
|
|
16
|
+
The ESM entry is `branch-video-player-sdk`; the UMD build exposes
|
|
17
17
|
`BranchVideoPlayerSDK`. For a WeChat `web-view` or another non-DOM host, import
|
|
18
18
|
the pure URL entry instead:
|
|
19
19
|
|
|
20
20
|
```ts
|
|
21
|
-
import { buildBranchVideoPlayerUrl } from '
|
|
21
|
+
import { buildBranchVideoPlayerUrl } from 'branch-video-player-sdk/url'
|
|
22
22
|
|
|
23
23
|
const src = buildBranchVideoPlayerUrl({
|
|
24
24
|
runtimeUrl: 'https://player.example.com/player.html',
|
|
@@ -38,3 +38,16 @@ under paths on one origin.
|
|
|
38
38
|
Subscribe with `player.on()` to `loaded`, `ready`, `statechange`, `progress`,
|
|
39
39
|
`ended`, `error`, `bufferchange`, `milestone`, and `exitrequested`. `play`,
|
|
40
40
|
`pause`, and `seek` issued before trusted `ready` are queued in order.
|
|
41
|
+
|
|
42
|
+
## Web learning observations (0.2.10+)
|
|
43
|
+
|
|
44
|
+
The Runtime can report privacy-minimized Web learning observations through the existing `milestone` event. These observations are included in 0.2.10 and later; 0.2.9 does not contain them. No new SDK event name is required.
|
|
45
|
+
|
|
46
|
+
- `schemaVersion: 1`
|
|
47
|
+
- `type: web_step_visible | web_step_message`
|
|
48
|
+
- `nodeId`, `visitId`, `contentUrl` (origin + pathname only)
|
|
49
|
+
- Status messages additionally contain `messageName` and `messageStatus`.
|
|
50
|
+
|
|
51
|
+
Visibility is observed after the Runtime's existing Web visual handoff, not simply on node change. Status messages reuse the current origin/source fence and visit deduplication. Source-less legacy calls may still route for compatibility but are never telemetry. Initial UEStatus=0 and free-text payloads are excluded. Observer exceptions cannot stop playback or alter routing.
|
|
52
|
+
|
|
53
|
+
A status observation is **not a success verdict**. The host must apply an explicit content-specific completion contract; it must not assume the same numeric UEStatus means completed, skipped or timed out for every page. No answer bodies, initData or credential query values are forwarded.
|