forked from pquiring/javaforce
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestMedia.java
More file actions
51 lines (39 loc) · 1.07 KB
/
Copy pathTestMedia.java
File metadata and controls
51 lines (39 loc) · 1.07 KB
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
package javaforce.webui;
/** Test WebUI.
*
* @author pquiring
*/
import java.io.*;
import javaforce.*;
import javaforce.webui.event.*;
import javaforce.service.*;
public class TestMedia implements WebUIHandler {
public TestMedia() {
}
public static void main(String[] args) {
new WebUIServer().start(new TestMedia(), 8080);
}
public void clientConnected(WebUIClient client) {}
public void clientDisconnected(WebUIClient client) {
System.exit(0);
}
public byte[] getResource(String url, HTTP.Parameters params, WebResponse res) {
//TODO : return static images, etc needed by webpage
return null;
}
public Panel getPanel(String name, HTTP.Parameters params, WebUIClient client) {
Panel panel = new Panel();
Video video = new Video();
video.setWidth(256);
video.setHeight(256);
panel.add(video);
Button b = new Button("Start");
panel.add(b);
b.addClickListener(new Click() {
public void onClick(MouseEvent me, Component c) {
video.sendEvent("video_init", null);
}
});
return panel;
}
}