Embed: support without localStorage
This commit is contained in:
		
							parent
							
								
									aa3527dcb0
								
							
						
					
					
						commit
						4fd6d14744
					
				
					 3 changed files with 25 additions and 4 deletions
				
			
		| 
						 | 
					@ -303,7 +303,7 @@ MistPlayer.prototype.buildMistControls = function(){
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  volume.className = 'volume';
 | 
					  volume.className = 'volume';
 | 
				
			||||||
  sound.title = 'Volume';
 | 
					  sound.title = 'Volume';
 | 
				
			||||||
  if ('mistVolume' in localStorage) {
 | 
					  if (('localStorage' in window) && (localStorage != null) && ('mistVolume' in localStorage)) {
 | 
				
			||||||
    ele.volume = localStorage['mistVolume'];
 | 
					    ele.volume = localStorage['mistVolume'];
 | 
				
			||||||
    volume.style.height = ele.volume*100+'%';
 | 
					    volume.style.height = ele.volume*100+'%';
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
| 
						 | 
					@ -452,7 +452,7 @@ MistPlayer.prototype.buildMistControls = function(){
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (i == 'subtitle')  {
 | 
					        if (i == 'subtitle')  {
 | 
				
			||||||
          s.value = 0;
 | 
					          s.value = 0;
 | 
				
			||||||
          if ('mistSubtitle' in localStorage) {
 | 
					          if (('localStorage' in window) && (localStorage != null) && ('mistSubtitle' in localStorage)) {
 | 
				
			||||||
            var option = s.querySelector('[data-lang="'+localStorage['mistSubtitle']+'"]');
 | 
					            var option = s.querySelector('[data-lang="'+localStorage['mistSubtitle']+'"]');
 | 
				
			||||||
            if (option) {
 | 
					            if (option) {
 | 
				
			||||||
              s.value = option.value;
 | 
					              s.value = option.value;
 | 
				
			||||||
| 
						 | 
					@ -1082,7 +1082,7 @@ function mistPlay(streamName,options) {
 | 
				
			||||||
      catch (e) {
 | 
					      catch (e) {
 | 
				
			||||||
        //show the next player/reload buttons if there is an error in the player build code
 | 
					        //show the next player/reload buttons if there is an error in the player build code
 | 
				
			||||||
        options.target.appendChild(player.element);
 | 
					        options.target.appendChild(player.element);
 | 
				
			||||||
        player.askNextCombo('Error while building player');
 | 
					        player.askNextCombo('Error while building player: '+e.stack);
 | 
				
			||||||
        throw e;
 | 
					        throw e;
 | 
				
			||||||
        player.report({
 | 
					        player.report({
 | 
				
			||||||
          type: 'init',
 | 
					          type: 'init',
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -119,6 +119,28 @@
 | 
				
			||||||
              //forceSource: 3,
 | 
					              //forceSource: 3,
 | 
				
			||||||
              loop: true,
 | 
					              loop: true,
 | 
				
			||||||
              //controls: 'stock'
 | 
					              //controls: 'stock'
 | 
				
			||||||
 | 
					              streaminfo: {
 | 
				
			||||||
 | 
					                source: [{
 | 
				
			||||||
 | 
					                  type: 'html5/video/mp4',
 | 
				
			||||||
 | 
					                  url: 'http://localhost:8080/bunny.mp4'
 | 
				
			||||||
 | 
					                },{
 | 
				
			||||||
 | 
					                  type: 'html5/application/vnd.apple.mpegurl',
 | 
				
			||||||
 | 
					                  url: 'http://localhost:8080/hls/bunny/index.m3u8'
 | 
				
			||||||
 | 
					                },{
 | 
				
			||||||
 | 
					                  type: 'dash/video/mp4',
 | 
				
			||||||
 | 
					                  url: 'http://localhost:8080/dash/bunny/index.mpd'
 | 
				
			||||||
 | 
					                },{
 | 
				
			||||||
 | 
					                  player_url: '/flashplayer.swf',
 | 
				
			||||||
 | 
					                  type: 'flash/10',
 | 
				
			||||||
 | 
					                  url: 'rtmp://localhost:1935/play/bunny'
 | 
				
			||||||
 | 
					                }],
 | 
				
			||||||
 | 
					                meta: {
 | 
				
			||||||
 | 
					                  tracks: []
 | 
				
			||||||
 | 
					                },
 | 
				
			||||||
 | 
					                height: 404,
 | 
				
			||||||
 | 
					                width: 720,
 | 
				
			||||||
 | 
					                type: 'vod'
 | 
				
			||||||
 | 
					              },
 | 
				
			||||||
              callback: function(player) {
 | 
					              callback: function(player) {
 | 
				
			||||||
                var button = document.createElement('button');
 | 
					                var button = document.createElement('button');
 | 
				
			||||||
                button.innerHTML = 'askNextCombo();';
 | 
					                button.innerHTML = 'askNextCombo();';
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -162,7 +162,6 @@ p.prototype.build = function (options) {
 | 
				
			||||||
      me.addlog('Player event fired: '+e.type);
 | 
					      me.addlog('Player event fired: '+e.type);
 | 
				
			||||||
    },true);
 | 
					    },true);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  
 | 
					 | 
				
			||||||
  return cont;
 | 
					  return cont;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
p.prototype.play = function(){ return this.element.play(); };
 | 
					p.prototype.play = function(){ return this.element.play(); };
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue