-
Notifications
You must be signed in to change notification settings - Fork 15
Enable AutoPlay & Stop for Videos #19
Copy link
Copy link
Open
Labels
Description
Research if there's a way to have remark.js etc. autoplay HTML5 local video on switching to a slide with video on it.
Some Links:
- https://stackoverflow.com/questions/19519084/remove-autoplay-attribute-from-video-element
- https://github.com/gnab/remark/wiki/Configuration
- onplaying="this.controls=false" as shown in https://moodle.org/mod/forum/discuss.php?d=268528
- https://stackoverflow.com/questions/33115728/how-can-i-make-a-html-video-play-one-once-until-the-page-is-reloaded
- https://github.com/gnab/remark/blob/c841b9bd575d2513ad48241dad6c94b250638a12/src/remark/models/slideshow/events.js
This is the data structure of each slide's data:
,[object Object],
,[object Object],
,[object Object],
Previous attempts to code this:
// Events: 'showSlide', 'hideSlide', 'beforeShowSlide', 'afterShowSlide', 'beforeHideSlide', 'afterHideSlide', 'toggledPresenter'
slideshow.on('showSlide', function(slide) {
var slideName = slide.properties.name;
// console.log(slideName);
console.dir(slide.content);
if (slide.content[1] !== null && typeof slide.content[1] === 'object') {
console.dir(slide.content[1].content);
// slide.content[1].content.getElementsByTagName('video')[0].setAttribute('autoplay','');
// console.dir(slide.content[1].content['video']);
}
// console.dir(slide.content.keys()); // console: ['foo']
/* if(document.querySelector('video')){ // checks if element is playing right now
alert('Boom!');
}*/
});
Reactions are currently unavailable