|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
2 <html dir="ltr" xml:lang="fr" xmlns="http://www.w3.org/1999/xhtml" lang="fr"> |
|
3 |
|
4 <head> |
|
5 <title>Metadataplayer - Widget tutorial</title> |
|
6 </head> |
|
7 |
|
8 <body> |
|
9 |
|
10 <div style="width:650px;font-family: 'Trebuchet MS', 'Helvetica', 'Arial', 'Verdana', 'sans-serif';"> |
|
11 <h1>MetaDataPlayer</h1> |
|
12 </div> |
|
13 |
|
14 If you're seeing nothing, it's because you've probably forgotten to run the build script. |
|
15 Run sbin/build/compil.sh to compile the files together. |
|
16 <!-- load the player file, and then our tutorial widget --> |
|
17 <script type="text/javascript" src="../../build/LdtPlayer-release.js" type="text/javascript"></script> |
|
18 <script type="text/javascript" src="LdtPlayer-tutorial.js" type="text/javascript"></script> |
|
19 |
|
20 <!-- this is the div the player will instantiate itself--> |
|
21 <div id="LdtPlayer"></div> |
|
22 |
|
23 <script type="text/javascript"> |
|
24 var file = "../../test/integration/polemic_fr.json"; |
|
25 |
|
26 /* This is the player configuration */ |
|
27 var config = { |
|
28 /* The first part of the config, config.gui, describes the gui options and the widgets. */ |
|
29 gui:{ |
|
30 width:650, |
|
31 container:'LdtPlayer', /* container div where the player will instantiate itself */ |
|
32 css:'../../src/css/LdtPlayer.css', /* where to get the css from */ |
|
33 |
|
34 /* default options for the widgets, to keep things DRY. |
|
35 We put the metadata config there because the widgets often get their data from the same sources, |
|
36 Also not that re-defining a field that was defined in default_options overrides its value. |
|
37 */ |
|
38 default_options : { |
|
39 metadata:{ |
|
40 src:file, |
|
41 type:'json' /* determines how the data will be loaded */ |
|
42 } |
|
43 }, |
|
44 /* this is the list of the widget that are going to be instantiated |
|
45 We're going for a minimal player here, so we're only going to instantiate |
|
46 a basic gui, a seekbar and our tutorial widget. |
|
47 */ |
|
48 widgets: [ |
|
49 /* the type of the widget corresponds to the name of its constructor. |
|
50 For instance, type: "SliderWidget" means to instantiate IriSP.SliderWidget |
|
51 */ |
|
52 {type: "SliderWidget"}, |
|
53 {type: "PlayerWidget"}, |
|
54 {type: "TutorialWidget"}, |
|
55 ] |
|
56 }, |
|
57 /* second part of the config - player options */ |
|
58 player:{ |
|
59 /* type of the player to instantiate - available values are |
|
60 jwplayer, html5, youtube, etc. |
|
61 */ |
|
62 type:'jwplayer', |
|
63 /* the rest are options for the jwplayer */ |
|
64 live: true, |
|
65 height: 300, |
|
66 width: 640, |
|
67 provider: "rtmp", |
|
68 file: "video/ldtplatform/museologie_inaugurale_20111018_flat.f4v", |
|
69 streamer: "rtmp://media.iri.centrepompidou.fr/ddc_player/" |
|
70 }, |
|
71 /* modules - modules are things similar to widgets, except that they |
|
72 don't live in a div. |
|
73 */ |
|
74 modules: [ |
|
75 /* the mediafragment module updates the url of the video to allow |
|
76 sharing a specific moment in a video |
|
77 */ |
|
78 { type: "MediaFragment", |
|
79 metadata:{ |
|
80 format:'cinelab', |
|
81 src:file, |
|
82 type:'json'} |
|
83 }] |
|
84 |
|
85 }; |
|
86 |
|
87 // init the player, specifying the config and a basic config file |
|
88 // for media autoconfig. |
|
89 IriSP.initPlayer(config, file); |
|
90 </script> |
|
91 |
|
92 |
|
93 </body> |
|
94 </html> |