var media = document.querySelectorAll('video, audio');
var rate = prompt('Speed?','');
Array.prototype.forEach.call(media, function(player) {
   player.playbackRate = rate;
});

var media = document.querySelectorAll('video, audio');
var rate = prompt('Speed? Currently playing back at ' + media[0].playbackRate + 'x.','');
Array.prototype.forEach.call(media, function(player) {
   if (rate != 0) {
      player.playbackRate = rate;
   } else {
      player.playbackRate = 1;
   }
});

Include current playback rate in prompt.
Include current playback rate in prompt.

Prevent setting playback rate to 0.