npaw_forge_theoplayer 10.4.0
npaw_forge_theoplayer: ^10.4.0 copied to clipboard
NPAW Forge adapter for the THEOplayer Flutter SDK: reports the typed playback lifecycle plus active-quality QoS facts to the Forge core.
npaw_forge_theoplayer #
NPAW Forge analytics adapter for the theoplayer
Flutter SDK (THEOplayer). Reports the typed playback lifecycle and the
track-quality QoS facts the Flutter SDK exposes to the Forge core, mirroring
the Forge Web THEOplayer adapter's event mapping.
Usage #
import 'package:npaw_forge/npaw_forge.dart';
import 'package:npaw_forge_theoplayer/npaw_forge_theoplayer.dart';
import 'package:theoplayer/theoplayer.dart';
final forge = await NpawForge.start(
const ForgeConfig(accountCode: 'yourAccount', appName: 'yourApp'),
);
final player = THEOplayer(
theoPlayerConfig: THEOplayerConfig(license: 'yourTHEOLicense'),
);
final attachment = await attachTheoplayer(
forge,
player,
metadata: const ContentMetadata(title: 'Big Buck Bunny'),
);
player.source = SourceDescription(
sources: [TypedSource(src: 'https://example.com/stream.m3u8')],
);
// when playback ends for good:
await attachment.dispose();
Event mapping (Web-adapter parity) #
| THEOplayer event | Forge fact |
|---|---|
SOURCECHANGE |
stop (closes the previous view) |
PLAY |
start |
TIMEUPDATE (playhead > 0 or live) |
join; closes seek/buffer while not paused |
PLAYING |
resume + buffer end (+ start/join gate) |
PAUSE (not seeking) |
pause |
WAITING (not paused, not seeking) |
buffer begin |
SEEKING / SEEKED |
seek begin / seek end |
ENDED |
stop |
ERROR |
fatal error |
QoS scope #
| Fact | Source | Available |
|---|---|---|
| Playhead, duration, live flag, playrate | player properties | yes |
| Bitrate | enabled video track activeQuality.bandwidth |
yes |
| Frames per second | activeQuality.frameRate |
yes |
| Rendition | quality name, else WxH (fallback videoWidth/videoHeight) |
yes |
| Video/audio codec | active quality codecs |
yes |
| Audio language | enabled audio track (und falls back to label) |
yes |
| Live latency | currentProgramDateTime vs wall clock |
yes (live only) |
Throughput (metrics.currentBandwidthEstimate) |
not surfaced by the Flutter SDK | no (null) |
Dropped frames (metrics.droppedVideoFrames) |
not surfaced by the Flutter SDK | no (null) |
| Player version | not surfaced by the Flutter SDK | no (null) |
Validation status #
Contract-verified: compiled against the real theoplayer pub SDK and covered
by fake-SDK lifecycle tests. Live end-to-end validation is pending a
THEOplayer license; the example app takes one at run time via
--dart-define=THEO_LICENSE=... (never committed).