Skip to content

Instantly share code, notes, and snippets.

@alexkirsz
Created October 2, 2016 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexkirsz/8bf23209ca8831866f2781b05f3fa0a4 to your computer and use it in GitHub Desktop.
Save alexkirsz/8bf23209ca8831866f2781b05f3fa0a4 to your computer and use it in GitHub Desktop.
Decent OfficeMix player
// ==UserScript==
// @name Decent OfficeMix player
// @version 1.0
// @description Remove paused logo and add keyboard controls to the OfficeMix player
// @author Alexandre Kirszenberg <alexandre.kirszenberg@gmail.com>
// @run-at document-start
// @match https://mix.office.com/embed/*
// @grant none
// ==/UserScript==
document.addEventListener('DOMContentLoaded', () => {
const load = Player.load;
Player.load = function(...args) {
const [options, ...otherArgs] = args;
const newOptions = Object.assign({}, options, {
logoOnPause: false,
});
const player = load.apply(this, [newOptions, ...otherArgs]);
document.querySelector('#pptViewerAnchor-MicrosoftEducation').style.pointerEvents = 'none';
document.addEventListener('keydown', e => {
if (e.code === 'Space') {
if (player.clock.isActive()) {
player.control.pause();
} else {
player.control.play();
}
}
});
return player;
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment