function createPluginForUrl(streamUrl, url, headers, progressCallback) {
  var plugin = document.createElement('embed');
    plugin.type = 'application/x-google-chrome-pdf';
    plugin.addEventListener('message', function(message) {
      switch (message.data.type.toString()) {
        case 'loadProgress':
          progressCallback(message.data.progress);
        break;
      }
    }, false);

    plugin.setAttribute('src', url);
    plugin.setAttribute('stream-url', streamUrl);
    plugin.setAttribute('full-frame', '');
    plugin.setAttribute('headers', headers);
    document.body.appendChild(plugin);
}
// Load a plugin with the given paramaters.
Load a plugin with the given paramaters.
Load a plugin with the given paramaters .
function createPluginForUrl(streamUrl, url, headers, progressCallback) {
  var plugin = document.createElement('embed');
    plugin.type = 'application/x-google-chrome-pdf';
    plugin.addEventListener('message', function(message) {
      switch (message.data.type.toString()) {
        case 'loadProgress':
          progressCallback(message.data.progress);
        break;
      }
    }, false);
    plugin.setAttribute('src', url);
    plugin.setAttribute('stream-url', streamUrl);
    plugin.setAttribute('full-frame', '');
    plugin.setAttribute('headers', headers);
    document.body.appendChild(plugin);
}
function createPluginForUrl ( streamUrl , url , headers , progressCallback ) { var plugin = document . createElement ( 'embed' ) ; plugin . type = 'application/x-google-chrome-pdf' ; plugin . addEventListener ( 'message' , function ( message ) { switch ( message . data . type . toString ( ) ) { case 'loadProgress' : progressCallback ( message . data . progress ) ; break ; } } , false ) ; plugin . setAttribute ( 'src' , url ) ; plugin . setAttribute ( 'stream-url' , streamUrl ) ; plugin . setAttribute ( 'full-frame' , '' ) ; plugin . setAttribute ( 'headers' , headers ) ; document . body . appendChild ( plugin ) ; }
Load a plugin with the given paramaters.
Load a plugin with the given paramaters .