2013-08-28 93 views
0

我想在J2ME中播放視頻,我使用的代碼是麻煩與視頻J2ME

 int index = 0; 

     LoadVideo(index); 

     String url = "file:///e:/videos/Abc.3gp"; 

       try{ 
         Player p = Manager.createPlayer(url); 
         p.realize(); 

         //Get the video controller 
         VideoControl video = (VideoControl) p.getControl("VideoControl"); 

         //Get a GUI to display the video 
         Item videoItem = (Item)video.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null); 
         //videoItem.setPreferredSize(100, 200); 
         //Append the GUI to a form 
         form.append(videoItem); 

         display.setCurrent(form); 

         //Start the video 
         p.start(); 
       }catch(IOException ioe){ } catch(MediaException me){ } 

的問題是視頻只能在小屏幕模式播放時,我怎樣才能使它適合適合顯示,有人請幫助我....

回答

0

您應該使用VideoControl對

videoControl.setDisplaySize(寬度,高度);

注:但在一些諾基亞手機3gp視頻不縮放。

希望這會幫助你。