Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
New Contributor
Posts: 6
Registered: ‎07-27-2010
My Device: Not Specified

I am unable to play remote video either in simulator or in device

Dear Friends,

 

                       I am trying to play a video from remote. And the video is not playing either in simulator (Storm2 9550) or in real device(BOLD 9770).

                      I am getting "JVM ERROR 104 Uncaught: RuntimeException".

 

                       I am able to play local video (3gp video) in real device.but unable to play remote video.

 

My java code is as below:

 

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.component.*;
import javax.microedition.media.*;
import javax.microedition.media.control.*;
import java.io.*;

public class VideoPlaybackDemo extends UiApplication
{
    public static void main(String[] args)
    {
        VideoPlaybackDemo app = new VideoPlaybackDemo();
        app.enterEventDispatcher();
    }
   
    public VideoPlaybackDemo()
    {
        pushScreen(new VideoPlaybackDemoScreen());
    }

    private class VideoPlaybackDemoScreen extends MainScreen
    { 
        public VideoPlaybackDemoScreen()
        {
            try
            {
                Player player = javax.microedition.media.Manager.createPlayer("http://www.example.com/LOONEYTUNESFANCLUB/Looney_Riddle.3gp;deviceside=true");
                player.realize();
                VideoControl videoControl = (VideoControl) player.getControl("VideoControl");
                Field videoField = (Field)videoControl.initDisplayMode( VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field" );

                add(videoField);

                VolumeControl volume = (VolumeControl) player.getControl("VolumeControl");
                volume.setLevel(30);

                player.start();
            }
            catch(MediaException me)
            {
                Dialog.alert(me.toString());
            }
            catch(IOException ioe)
            {
                Dialog.alert(ioe.toString());
            }
        }
    }
}

 

Any kind of help is appreciated.

 

Hari.