Domanda

C'è un modo per lo streaming e riprodurre file video dal server?

La mora fornisce alcuna built-in video player in cui posso riprodurre il video in streaming?

È stato utile?

Soluzione

Sì, è possibile. Ci sono due modi per lo streaming video sul dispositivo di BB:

  • utilizzando javax.microedition.media.Player dalla JSR-135
  • utilizzando standard di Media Application

Vedere Come - il video all'interno di un'applicazione BlackBerry smartphone

È possibile verificare sopra del browser BlackBerry su http://m.youtube.com
Come guardare i video di YouTube sul BlackBerry Bold 9000

Si dovrà utilizzare WAP o il protocollo WiFi per RTSP:
passerà al WAP per lo streaming media

Formati supportati su BlackBerry smartphone

Altri suggerimenti

Sto usando questo codice per aprire il player integrato (sia per i video remoti e locali):

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()));
    }
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top