Skip to content

Change Sync to a prop instead of a positional argument #1065

@kixelated

Description

@kixelated

Several APIs take Sync as the first positional argument rather than as a property in the options/props object:

const sync = new Watch.Sync();

// Currently: sync is first arg
const muxer = new Watch.Mse.Muxer(sync, { paused: false });
const videoSource = new Watch.Video.Source(sync, { broadcast });
const audioSource = new Watch.Audio.Source(sync, { broadcast });

It would be more consistent and ergonomic if sync were part of the props object:

const muxer = new Watch.Mse.Muxer({ sync, paused: false });
const videoSource = new Watch.Video.Source({ sync, broadcast });
const audioSource = new Watch.Audio.Source({ sync, broadcast });

This aligns with how other options like broadcast, paused, canvas etc. are already passed as props. Having sync as a separate positional argument is the odd one out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingBreaking API changesjavascriptPull requests that update Javascript code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions