From 999417328bde0e60cd59318fc1c18672356254ce Mon Sep 17 00:00:00 2001 From: William Lahti Date: Tue, 10 Jul 2018 08:47:56 -0700 Subject: Ability to programmatically control embeds (#776) * first stab at jschannel based player api * semicolon purge * more method-level docs; consolidate definitions * missing definitions * better match peertube's class conventions * styling for embed tester * basic docs * add `getVolume` * document the test-embed feature --- client/src/standalone/player/player.ts | 190 +++++++++++++++++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 client/src/standalone/player/player.ts (limited to 'client/src/standalone/player/player.ts') diff --git a/client/src/standalone/player/player.ts b/client/src/standalone/player/player.ts new file mode 100644 index 000000000..9fc648d25 --- /dev/null +++ b/client/src/standalone/player/player.ts @@ -0,0 +1,190 @@ +import * as Channel from 'jschannel' +import { EventRegistrar } from './events' +import { EventHandler, PlayerEventType, PeerTubeResolution } from './definitions' + +const PASSTHROUGH_EVENTS = [ + 'pause', 'play', + 'playbackStatusUpdate', + 'playbackStatusChange', + 'resolutionUpdate' +] + +/** + * Allows for programmatic control of a PeerTube embed running in an