سؤال

هل هناك أي طريقة لتدفق وتشغيل ملفات الفيديو من الخادم؟

هل يوفر BlackBerry أي مشغل فيديو مدمج حيث يمكنني تشغيل الفيديو البارد؟

هل كانت مفيدة؟

المحلول

نعم يمكنك. هناك طريقتان لتدفق الفيديو على جهاز BB:

  • باستخدام javax.microedition.media.player من JSR-135
  • باستخدام تطبيق الوسائط القياسية

يرى كيفية - تشغيل الفيديو داخل تطبيق الهاتف الذكي بلاك بيري

يمكنك اختباره على متصفح BlackBerry http://m.youtube.com.
كيفية مشاهدة أشرطة الفيديو YouTube على BlackBerry Bold 9000

سيتعين عليك استخدام بروتوكول WAP أو WIFI الخاص ب RTSP:
سيتم التبديل تطبيق الوسائط إلى WAP لتدفق الوسائط

أنواع الوسائط المدعومة على هاتف BlackBerry الذكي

نصائح أخرى

أنا أستخدم هذا الرمز لفتح المشغل المدمج (كلاهما للمقاطع الفيديو عن بعد المحلية):

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()));
    }
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top