2009-09-19 5 views
2

서버에서 비디오 파일을 스트리밍 및 재생할 수있는 방법이 있습니까?Blackberry에서 비디오 스트리밍

블랙 베리는 스트리밍 된 비디오를 재생할 수있는 기본 제공 비디오 플레이어를 제공합니까?

답변

7

가능합니다. BB 장치에 비디오 스트리밍하는 방법은 두 가지가 있습니다 : 표준 미디어 응용 프로그램을 사용하여 JSR-135

  • 에서 javax.microedition.media.Player를 사용

    참조 How To - Play video within a BlackBerry smartphone application

    당신이 할 수있는 BlackBerry 브라우저에서 테스트하십시오. http://m.youtube.com
    How to watch YouTube Videos on BlackBerry Bold 9000 123,414,당신은 RTSP를위한 WAP 또는 무선 프로토콜을 사용해야합니다 :
    Media application will switch to WAP for streaming media

    Media types supported on the BlackBerry smartphone

  • 1

    내가 (둘 다 원격 및 로컬 비디오 용) 내장 플레이어를 열려면이 코드를 사용하고 있습니다 :

    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())); 
        } 
    } 
    
    +0

    나는 이것이 OS 6에서만 작동한다고 생각하십니까? – Ajibola