Created
October 2, 2016 12:16
-
-
Save alexkirsz/8bf23209ca8831866f2781b05f3fa0a4 to your computer and use it in GitHub Desktop.
Decent OfficeMix player
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Decent OfficeMix player | |
// @version 1.0 | |
// @description Remove paused logo and add keyboard controls to the OfficeMix player | |
// @author Alexandre Kirszenberg <[email protected]> | |
// @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