Streaming de vídeo en Blackberry
-
11-09-2019 - |
Pregunta
¿Hay alguna forma para transmitir y reproducir archivos de vídeo desde el servidor?
¿Se contempla en mora ninguna función de reproductor de vídeo en el que puedo reproducir el vídeo streaming?
Solución
Sí se puede. Hay dos maneras de transmitir vídeo en el dispositivo bb:
- usando javax.microedition.media.Player de JSR-135
- utilizando el estándar Media Application
Consulte Cómo - reproducción de vídeo dentro de una aplicación para teléfonos inteligentes BlackBerry
Puede probarlo sobre el navegador de BlackBerry en http://m.youtube.com
Cómo ver vídeos de YouTube en el BlackBerry Bold 9000
Usted tendrá que utilizar WAP o el protocolo RTSP para WiFi:
aplicación Media noreferrer"> tipos de material compatibles en el teléfono inteligente BlackBerry
Otros consejos
Estoy usando este código para abrir el reproductor integrado (ambos videos remotos y locales):
private void handleVideo(String url) {
try {
Invocation inv = new Invocation();
if (url.startsWith("local")) {
url = url.substring(url.lastIndexOf('/'));
InputStream is = getClass().getResourceAsStream("/res" + url);
if (is == null)
return;
// move resource to device memory so that we get an url which
// can be passed to Invocation
url = "file:///store/home/user/videos" + url;
FileConnection dest = (FileConnection) Connector.open(url);
if (!dest.exists())
dest.create();
dest.setWritable(true);
OutputStream o = dest.openOutputStream();
byte[] buf = new byte[8192];
int length = -1;
while ((length = is.read(buf)) > 0)
o.write(buf, 0, length);
o.close();
is.close();
dest.close();
}
inv.setID(BlackBerryContentHandler.ID_MEDIA_CONTENT_HANDLER);
inv.setArgs(new String[] { BlackBerryContentHandler.MEDIA_ARGUMENT_VIEW_MEDIA });
inv.setURL(url);
Registry reg = Registry.getRegistry(getClass().getName());
reg.invoke(inv);
} catch (Throwable e) {
UiApplication.getUiApplication().invokeAndWait(new RunnableDialog(e.getMessage()));
}
}