Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow media to be embedded in slides, synchronized #67

Open
banksJeremy opened this issue Jun 13, 2012 · 1 comment
Open

Allow media to be embedded in slides, synchronized #67

banksJeremy opened this issue Jun 13, 2012 · 1 comment

Comments

@banksJeremy
Copy link
Collaborator

Greg suggested the ability to embed audio and video in slides.

It seems like it would be great if we could do this, while keeping those element's playback synchronized with the presentation overall. We could hide/disable the controls on the individual media elements, and just let them be controlled through the main controls (playback as well as muting).

There doesn't seem to be a built-in way to synchronize multiple Players, but it probably won't be too horrible.

Attaching sub-slides/animations to a per-slide synchronized BasePlayer might be a clean way to integrate that, too.

@banksJeremy
Copy link
Collaborator Author

Something like...

function sync( master, slave, offset ) {
  slave.controls(false);
  slave.currentTime( master.currentTime() - offset );

  if ( master.paused() ) {
    slave.pause();
  } else {
    slave.play();
  }

  master.on( "seeking", function() { slave.pause(); } );
  master.on( "seeked", function() {
    slave.currentTime( master.currentTime() - offset );
    // or the new time is outside of slave's time, pause it
  });

  // playing, pause, volumechange
}

And then, for each slide:

if ( slide.media ) {
  sync( popcorn, slide.media, slide.start );
}

edit: actually, trying to make something entirely general may be unwise. Don't register handlers for every slide, just have one set of handlers and use deck.change to stay aware of what synced media is active.

banksJeremy pushed a commit to jeremyBanks/slide-drive that referenced this issue Jun 14, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant