File: README

package info (click to toggle)
cortado 0.5.2-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 1,644 kB
  • ctags: 3,122
  • sloc: java: 21,207; xml: 571; sh: 95; makefile: 16
file content (292 lines) | stat: -rw-r--r-- 9,124 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
WHAT IT IS
----------

This is Cortado, a multimedia framework for Java written by Fluendo.

It contains:
- JST, a port of the GStreamer 0.10 design to Java
- jcraft, a copy of the JCraft JOgg/Jorbis code
- jheora, an implementation of Theora in Java
- jkate, an implementation of a basic Kate decoder in Java
- jtiger, a basic Kate renderer (simple text/images only for now)
- codecs (currently only containing the Smoke codec, a variant on Jpeg)
- JST plugins for:
  - HTTP source element
  - Ogg and Multipart demuxers
  - Theora, JPEG and Smoke video decoders
  - Vorbis and MuLaw audio decoders
   - Java 1.1 sun.audio API audio sink
   - Java 1.4 javax.sound.sampled API audio sink
  - Overlay element
  - Kate text decoder and overlay
  - Selector element
- examples
- applets

This release has support for
- seeking in on-demand files
- the above-mentioned plugins
- basic HTTP authentication
- buffering

FAQ
---

For frequently asked questions check our website at http://theora.org/cortado/

If any questions should be added, let us know.

BUGS
----

You can file bugs at Xiph's issue tracker:
https://trac.xiph.org/newticket?component=Cortado

Make sure to choose the "Cortado" component.

BUILDING
--------

The build uses ant exclusively now.

Normally, running

  ant

Should build everything, if your system is setup correctly.

You can copy build.config.sample to build.config and tweak it to choose
certain settings.

Run

  ant -p

to see all the possible targets.

EXAMPLES
--------

You need a Java Virtual Machine to run the example code.
You also need to set the classpath to your build tree when running
(output/build/debug or output/build/stripped)

- Jikes does not have a VM
- gij (the GNU Java VM) does not have a javax.sound.sampled implementation, so
  fails when playing audio, but can still play video-only files
- Sun Java VM works for me:

  /usr/java/jre1.5.0_04/bin/java -cp output/build/debug com.fluendo.examples.Player http://stream.fluendo.com:8850

  (with a JPackage java-1.5.0-sun package)
  /usr/lib/jvm/java-1.5.0-sun-1.5.0.05/jre/bin/java -cp output/build/debug com.fluendo.examples.Player http://stream.fluendo.com:8850


USAGE
-----

Embed the applet in a web page with code like this:

----
<html>
 <head>
 </head>
 <body>
   <applet code="com.fluendo.player.Cortado.class" 
           archive="cortado.jar" 
	   width="352" height="288">
     <param name="url" value="http://localhost/test6.ogg"/>
     <param name="local" value="false"/>
     <param name="duration" value="232"/>
     <param name="keepAspect" value="true"/>
     <param name="video" value="true"/>
     <param name="audio" value="true"/>
     <param name="bufferSize" value="200"/>
     <param name="userId" value="user"/>
     <param name="password" value="test"/>
   </applet>
 </body>
</html>
----

parameters:
-----------

  url:        string
              the URL to load, must be a fully qualified URL.
              IMPORTANT: if the applet is not signed, the hostname of the
              url *is required* to be the same as the hostname of the link
              to the page with the applet tag.  This is a Java security limitation.

  seekable:   enum (auto|true|false)
              Whether or not you can seek in the file.  For live streams,
              this should be false; for on-demand files, this can be true.
	      In automatic mode, the stream becomes seekable when the content
	      length is discovered.
	      Defaults to auto

  live        enum (auto|true|false)
              Whether or not this file is a live stream.  For live streams,
              this should be true, which will disable the PAUSE button.
	      For on-demand files, this can be false.
	      In automatic mode, the stream becomes non-live when the content
	      length is discovered.
	      Defaults to auto

  duration:   int
              Length of clip in seconds.  Needed when seekable is true,
              to allow the seek bar to work.

  keepAspect: boolean
              Try to keep the natural aspect of the video when resizing the
              applet window. true or false.
	      Defaults to true

  ignoreAspect: boolean
              Ignore the aspect ratio as signalled by the video, always assume
              square pixels. true or false.
              Defaults to false

  video:      boolean
              Use video. When not using video, this property will not create
              resources to play a video stream. true or false.
	      Defaults to true
	      
  audio:      boolean
              Use audio. When not using audio, this property will not create
              resources to play an audio stream. true or false.
	      Defaults to true

  kateIndex:  int
              Use text from the given Kate stream (indexed from zero).
              The first Kate stream found will have index 0, the second will
              have index 1, etc.
              Selecting a Kate stream by index takes priority over selecting
              by language and/or category.
              At most one Kate stream may be enabled at a time.
	      Defaults to -1 (none)

  kateLanguage: string
              Use text from the Kate stream with the given language (ISO 639-1 tag).
              Selecting a Kate stream by index takes priority over selecting
              by language and/or category.
              At most one Kate stream may be enabled at a time.
	      Defaults to null (none)

  kateCategory: string
              Use text from the Kate stream with the given category.
              Selecting a Kate stream by index takes priority over selecting
              by language and/or category.
              At most one Kate stream may be enabled at a time.
	      Defaults to null (none)

  statusHeight: int
              The height of the status area (default 12)

  autoPlay:   boolean
              Automatically start playback (default true)

  showStatus: enum (auto|show|hide)
              Controls how to make the status area visible. 
	      auto will show the status area when hovered over with the mouse.
	      hide will only show the status area on error.
	      show will always show the status area.
	      (default auto)

  showSpeaker: boolean
              Show a speaker icon when audio is available (default true)

  hideTimeout: int 
              Timeout in seconds to hide the status area when showStatus is
	      auto. This timeout is to make sure that the status area is visible
	      for the first timeout seconds of playback so that the user can see
	      that there is a clickable status area too.
	      (default 0)

  bufferSize: int
              The size of the network buffer, in KB.
              A good value is max Kbps of the stream * 33
              Defaults to 200

  bufferLow:  int
              Percentage of low watermark for buffer.  Below this, the applet
              will stop playing and rebuffer until the high watermark is
              reached.
              Defaults to 10

  bufferHigh: int
              Percentage of high watermark for buffer.  At startup or when
              rebuffering, the applet will not play until this percentage of
              buffer fill status is reached.
              Defaults to 70

  userId:     string
              user id for basic authentication.

  password:   string
              password for basic authentication.

  debug:      int
              debug level, 0 - 4.  Defaults to 3.  Output goes to the Java
              console.

Using javascript
----------------

The applet parameters can be changed from javascript by calling the
setParam(key, value) on the applet. After setting the new parameters in the
applet it needs to be restarted with the restart() method for the changes to
take effect.

The following piece of HTML demonstrates switching URLs with an without sound
using javascript:

----
<html>
 <head>
 </head>
 <body>
   <script language="javascript">
     function restart() {
       document.applets[0].restart(); 
     }
     function loadUrl(uri, audio) {
       document.applets[0].setParam("audio", audio); 
       document.applets[0].setParam("url", uri); 
       restart();
     }
   </script>
   <applet archive="cortado.jar" code="com.fluendo.player.Cortado.class" width="320" height="240"> 
     <param name="url" value="http://localhost:8800"/>
     <param name="local" value="false"/>
     <param name="framerate" value="5.0"/>
     <param name="keepaspect" value="true"/>
     <param name="video" value="true"/>
     <param name="audio" value="true"/>
   </applet>

   <br/>
   <br/>

   <button onClick="restart()">
    Restart
   </button>
   <button onClick="loadUrl('http://localhost:8800', 'true')">
    With Audio
   </button>
   <button onClick="loadUrl('http://localhost:8802', 'false')">
    Without Audio
   </button>
   
 </body>
</html>
----

The applet can be controlled with the following javascript methods:

  doPlay(): Start playback
  doPause(): Pause playback
  doStop(): Stop playback
  doSeek(double pos); seek to a new position, must be between 0.0 and 1.0.
  getPlayPosition(): returns current position in seconds