0

我想在 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){ }

问题是仅在小屏幕模式下播放视频,我怎样才能使其适合显示,请有人帮助我....

4

1 回答 1

0

You should use VideoControl

videoControl.setDisplaySize(WIDTH, HEIGHT);

Note: but in some nokia phone 3gp video does not scale.

hope this will help you.

于 2013-08-29T05:08:06.630 回答