[vlc-commits] web intf: delay loading of external ressource.

Francois Cartegnie git at videolan.org
Wed Sep 21 15:18:47 CEST 2011


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Sep 21 15:18:18 2011 +0200| [2bb2c48eeb5e7b51a74af507fedb387b822c44e1] | committer: Francois Cartegnie

web intf: delay loading of external ressource.

Must not block if we have no internet access

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2bb2c48eeb5e7b51a74af507fedb387b822c44e1
---

 share/lua/http/index.html |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/share/lua/http/index.html b/share/lua/http/index.html
index 0da414a..df65669 100644
--- a/share/lua/http/index.html
+++ b/share/lua/http/index.html
@@ -39,7 +39,6 @@
 		<script type="text/javascript" src="js/jquery-1.5.1.min.js"></script>
 		<script type="text/javascript" src="js/jquery-ui-1.8.13.custom.min.js"></script>
 		<script type="text/javascript" src="js/jquery.jstree.js"></script>
-		<script type="text/javascript" src="http://static.flowplayer.org/js/flowplayer-3.2.6.min.js"></script>
 		<script type="text/javascript" src="js/ui.js"></script>
 		<script type="text/javascript" src="js/controlers.js"></script>
 		<script type="text/javascript">
@@ -173,9 +172,7 @@
 								}
 								var defaultStream	=	'new Current broadcast enabled input "'+file+'" output #transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}:std{access='+$('#stream_protocol').val()+',mux=ffmpeg{{mux=flv}},dst=0.0.0.0:'+$('#stream_port').val()+'/'+$('#stream_file').val()+'}';
 								sendVLMCmd('del Current;'+defaultStream+';control Current play');
-								$('#player').empty();
 								$('#player').attr('href',$('#stream_protocol').val()+'://'+$('#stream_host').val()+':'+$('#stream_port').val()+'/'+$('#stream_file').val());
-								flowplayer("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf");
 								current_que			=	'stream';
 								updateStreams();
 							}
@@ -188,6 +185,12 @@
 				});
 				$('#viewContainer').animate({height: 'toggle'});
 			});
+			/* delay script loading so we won't block if we have no net access */
+			$.getScript('http://static.flowplayer.org/js/flowplayer-3.2.6.min.js', function(data, textStatus){
+				$('#player').empty();
+				flowplayer("player", "http://releases.flowplayer.org/swf/flowplayer-3.2.7.swf");
+				/* .getScript only handles success() */
+			 });
 		//]]>
 		</script>
 	</head>
@@ -253,7 +256,9 @@
 			<div id="viewContainer" class="ui-widget">
 				<div class="ui-widget-header" style="text-align: left;"><img src="images/vlc16x16.png" alt="VLC" width="16" height="16"/> Viewer</div>
 				<div id="mediaViewer" class="ui-widget-content">
-					<div href="http://localhost:8081/stream.flv" style="display:block; width:100%" id="player"></div>
+					<div href="http://localhost:8081/stream.flv" style="display:block; width:100%" id="player">
+						<p>Loading flowplayer...<br/>If nothing appears, check your internet connection.</p>
+					</div>
 				</div>
 			</div>
 			<div id="libraryContainer" class="ui-widget">



More information about the vlc-commits mailing list