Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ public void setPage(String html, String baseUrl) {

String id = BrowserPanel.getStreamRegistry().registerStream(stream);

String url = "https://cn1app/streams/"+id;
String url = "cn1stream://stream/"+id;
setURL(url);
} catch (Exception ex) {
setURL("data:text/html,"+com.codename1.io.Util.encodeUrl(html));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public InputStreamSchemeHandler() {
}

public static String getURL(String streamId) {
return scheme+"://"+domain+"/streams/"+streamId;
return scheme+"://streams/"+streamId;
}
private static final int LIMIT = 65536*2;
private int written;
Expand Down Expand Up @@ -133,7 +133,7 @@ public void getResponseHeaders(
}


//response_length.set(-1);
response_length.set(-1);
System.out.println("Set response length to "+response_length.get());

} else {
Expand Down Expand Up @@ -180,7 +180,7 @@ public synchronized boolean readResponse(

try {

if (stream.getStream().available() > 0) {
//if (stream.getStream().available() > 0) {
System.out.println("Abbout to attempt reading "+bytes_to_read);
int read = stream.getStream().read(data_out, 0, bytes_to_read > 0 ? Math.min(bytes_to_read, data_out.length) : data_out.length);

Expand All @@ -204,12 +204,12 @@ public synchronized boolean readResponse(
return true;
}

} else {
System.out.println("No bytes available");
bytes_read.set(0);
//} else {
//System.out.println("No bytes available");
//bytes_read.set(0);


}
//}
} catch (IOException ex) {
Log.e(ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ public AsyncResource<Media> createMediaAsync(InputStream inputStream, String mim

StreamWrapper stream = new StreamWrapper(inputStream, mimeType , -1);
String id = BrowserPanel.getStreamRegistry().registerStream(stream);
String uriAddress = "https://cn1app/streams/"+id;
String uriAddress = "cn1stream://streams/"+id;
try {
new CodenameOneMediaPlayer(uriAddress, mimeType.startsWith("video/"), (JFrame)cnt, onCompletion, out);
} catch (IOException ex) {
Expand Down Expand Up @@ -660,7 +660,7 @@ public AsyncResource<Media> createMediaAsync(String uriAddress, boolean isVideo,
StreamWrapper stream = new StreamWrapper(fis, getMimetype(f), f.length());
String id = BrowserPanel.getStreamRegistry().registerStream(stream);
//uriAddress = InputStreamSchemeHandler.getURL(id);
uriAddress = "https://cn1app/streams/"+id;
uriAddress = "cn1stream://streams/"+id;
//new CodenameOneMediaPlayer(stream, ((JFrame)cnt), onCompletion, out);
} catch (IOException ex) {
out.error(ex);
Expand Down