Skip to content

Tech documentation: list of required methods is incomplete #5737

Open
@yokuze

Description

@yokuze

Description

The Tech guide/documentation's list of required methods does not include some functions that Video.js requires Tech to implement. If a Tech is built without these required methods, the Video.js player will throw an error during common operations (play, seek, etc).

This was discovered while implementing a Chromecast plugin for Video.js. However, here's a reduced test case that demonstrates the error with a simple "Test" Tech, which is missing the seekable method: https://codepen.io/mluedke/pen/zyaVjX

Just to be clear: this ticket is not about the error that's thrown. I understand that's due to not implementing the seekable method in the Tech. It's just about updating the Tech guide/documentation so that the list of required Tech is complete.

Steps to reproduce

  1. Open https://codepen.io/mluedke/pen/zyaVjX
  2. Click the "Play" button
  3. Click the "Change Tech" button to change to the "Test" Tech
  4. Observe the console errors

Results

Expected

No console errors, because I would've implemented the seekable (and other) methods on my Tech if I'd known they were required.

Actual

My Tech throws errors because the list of required methods to implement when creating a Tech is missing several methods.

Error output

video.js:24027 Uncaught TypeError: this.tech_[method] is not a function

Additional Information

I searched the Video.js codebase for occurrences of techCall_ and techGet_ and compiled this list of methods that techCall_/techGet_ calls on the Tech but that are not implemented in the base Tech class and thus should possibly be documented as "required" (I removed methods that are already documented):

  • controls
  • defaultMuted
  • defaultPlaybackRate
  • ended
  • enterFullScreen
  • exitFullScreen
  • load
  • loop
  • muted
  • networkState
  • paused
  • playbackRate
  • preload
  • readyState
  • seekable
  • seeking
  • setAutoplay
  • setControls
  • setDefaultMuted
  • setDefaultPlaybackRate
  • setLoop
  • setMuted
  • setPlaybackRate
  • setPreload
  • setVolume
  • src

versions

videojs

7.x, but the same would happen for many previous versions of Video.js, presumably

browsers

All (presumably)

OSes

All (presumably)

plugins

None

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions