test/integration/layout-youtube.htm
author hamidouk
Wed, 26 Oct 2011 11:32:21 +0200
branchpopcorn-port
changeset 147 955119f901b4
parent 118 695e1086ddd2
permissions -rw-r--r--
added a function to search annotations to the json serializer.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
118
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
     1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
     2
<html dir="ltr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml" lang="fr">
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
     3
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
     4
<head>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
     5
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
     6
</head>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
     7
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
     8
<body>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
     9
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    10
	<div style="width:650px;font-family: 'Trebuchet MS', 'Helvetica', 'Arial',  'Verdana', 'sans-serif';">
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    11
	<h1>MetaDataPlayer </h1>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    12
	Test d'intégration du widget du gestionnaire de placement (avec Youtube).
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    13
	</div>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    14
	
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    15
	
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    16
 <!-- START Integration  ###################################### -->
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    17
 <!-- SIMPLE PLAYER EXPERIMENTATION -->
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    18
	<script type="text/javascript" src="../../build/LdtPlayer-release.js"></script> 
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    19
	<script src="../../res/js/jquery.min.js"></script>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    20
	<script src="../../res/js/jquery.tools.min.js"></script>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    21
	<script src="../../res/js/jquery-ui.min.js"></script>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    22
	
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    23
	<script  type="text/javascript">
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    24
	$(document).ready(function() {
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    25
		var config = {
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    26
						metadata:{
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    27
							format:'cinelab',
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    28
							src:'test.json',
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    29
							load:'json'},
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    30
						gui:{
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    31
							width:512,
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    32
							height:384,
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    33
							mode:'radio',
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    34
							container:'LdtPlayer',
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    35
							debug:true,
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    36
							css:'../../src/css/LdtPlayer.css'},
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    37
						player:{
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    38
							type:'jwplayer',
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    39
							src:'../res/swf/player.swf'}
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    40
					};
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    41
		
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    42
		IriSP.loadLibs(IriSP.lib, config.gui.css, function() {});
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    43
		
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    44
		templ = "width: {{width}}px; height: {{height}}px; margin-bottom: 5px;";
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    45
		var str = Mustache.to_html(templ, {width: config.gui.width, height: config.gui.height});    
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    46
		// Popcorn.youtube wants us to specify the size of the player in the style attribute of its container div.
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    47
		IriSP.jQuery("#video").attr("style", str);
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    48
		
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    49
		var pop = Popcorn.youtube("#video", "http://www.youtube.com/watch?v=lFtNG1wZ4zU", {controls: 0, autostart: false});    
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    50
		
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    51
		var dt = new IriSP.DataLoader();
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    52
		var ser = new IriSP.JSONSerializer(dt, "../test.json");
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    53
		var ser2 = new IriSP.JSONSerializer(dt, "../test.json");
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    54
		
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    55
		var lay = new IriSP.LayoutManager({divId : "LdtPlayer"});
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    56
		lay.setPopcornInstance(pop);
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    57
		
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    58
		//config.gui.container = lay.createDiv();
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    59
		var player = new IriSP.PlayerWidget(pop, config, ser);
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    60
		
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    61
		config.gui.container = lay.createDiv();
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    62
		var annotationWidget = new IriSP.AnnotationsWidget(pop, config, ser);
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    63
		
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    64
		config.gui.container = lay.createDiv();
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    65
		var segmentsWidget = new IriSP.SegmentsWidget(pop, config, ser);
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    66
		ser.sync(function() { player.draw();  annotationWidget.draw(); segmentsWidget.draw();});
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    67
		
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    68
	});
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    69
	</script>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    70
<div id='video'>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    71
</div>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    72
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    73
<div id="LdtPlayer">
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    74
</div>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    75
<!-- END  ################  ###################################### -->
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    76
 </body>
695e1086ddd2 added two layout integration testing files.
hamidouk
parents:
diff changeset
    77
 </html>