Skip to content

Instantly share code, notes, and snippets.

@kuu
Last active December 22, 2015 02:01
Show Gist options
  • Save kuu/23ab5334cbe80e95e926 to your computer and use it in GitHub Desktop.
Save kuu/23ab5334cbe80e95e926 to your computer and use it in GitHub Desktop.
```js
OO.ready(function() {
var container, video;
OO.Player.create('ooyalaplayer', 'ptb2kzeToiFcfXe7n-7ufBdcYVQWupMm', {
onCreate: function (player) {
player.mb.subscribe('preloadStream', 'example', function(eventName) {
if (!video) {
return;
}
var src = video.src,
idx = src.lastIndexOf('?_=');
if (idx !== -1) {
video.src = src.substring(0, idx);
}
});
}
});
container = document.querySelector('#ooyalaplayer');
video = container.querySelector('video');
});
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment