# Elm Media Control - API Proposal

**URL:** <https://discourse.elm-lang.org/t/elm-media-control-api-proposal/3006>\
**Category:** Request Feedback\
**Created:** [January 25, 2019, 12:15pm UTC](https://discourse.elm-lang.org/t/elm-media-control-api-proposal/3006 "2019-01-25T12:15:39Z")\
**Posts on this page:** 1\
**Showing post:** 25

<div class="post-metadata">

**Author:** ![Dan\_Abrams](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dan_abrams/32/3171_2.png) [@Dan\_Abrams](https://discourse.elm-lang.org/u/Dan_Abrams)\
**Post date:** [January 28, 2019, 9:53pm UTC](https://discourse.elm-lang.org/t/elm-media-control-api-proposal/3006/25 "2019-01-28T21:53:41Z")

</div>

> [@Dan\_Abrams](#):
>
> EDIT: There’s one more thing to try that may work well, give me an hour or so…

Didn’t event take me that long. Yeah, don’t know why I didn’t think of this sooner. This doesn’t result in frame-perfect sync, but it does provide an easy way to synchronize:

There’s an old api in the Media API called Controller, specifically designed to let you control multiple videos in sync. The following works:

```auto
const myController = new Controller();
video.controller = myController;
videoDuplicate.controller = myController;

function play(){
    controller.play();
}

function pause(){
    controller.pause();
}

function seek(time){
     controller.currentTime = time;
}

```

However, not every attribute works like this. `Volume, muted, playbackRate, currentTime` are all shared, but `loop, src, textTracks, autoplay` and others are individual. However, the ones that can be set on controller are the ones concerned with synchronization. Others, like loop, can simply be iterated through safely on each element.

EDIT: I’m really upset at myself for not thinking of this sooner. This is an obscure api, but fascinating to me, and I’ve been looking to find a good use for it for years.

---

_[View the full topic](https://discourse.elm-lang.org/t/elm-media-control-api-proposal/3006)._
