Code:
I have written a testform that reproduces the error:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.vodtec.mobile.lwuit;
import com.sun.lwuit.Command;
import com.sun.lwuit.Form;
import com.sun.lwuit.MediaComponent;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.layouts.BorderLayout;
import com.vodtec.mobile.media.LoggingPlayerListener;
import java.io.IOException;
import javax.microedition.media.Manager;
import javax.microedition.media.MediaException;
import javax.microedition.media.Player;
import javax.microedition.media.control.VideoControl;
import javax.microedition.media.control.VolumeControl;
/**
*
* @author jdesmedt
*/
public class MultiplePlayerForm extends Form {
MediaComponent mc0;
MediaComponent mc1;
Player[] players;
public MultiplePlayerForm(String url1, String url2, final Form parent) {
super("VideoTest");
Command back = new Command("Back") {
public void actionPerformed(ActionEvent arg0) {
parent.show();
players[0].close();
players[1].close();
mc0.stop();
mc1.stop();
}
};
addCommand(back);
setBackCommand(back);
try {
players = new Player[2];
players[0] = Manager.createPlayer(url1);
players[1] = Manager.createPlayer(url2);
players[0].realize();
players[0].prefetch();
players[1].realize();
players[1].prefetch();
players[0].addPlayerListener(new LoggingPlayerListener("player 1"));
players[1].addPlayerListener(new LoggingPlayerListener("player 2"));
mc0 = new MediaComponent(players[0]);
mc1 = new MediaComponent(players[1]);
setLayout(new BorderLayout());
addComponent(BorderLayout.WEST,mc0);
addComponent(BorderLayout.EAST,mc1);
mc0.setVisible(true);
mc1.setVisible(true);
VolumeControl voc = (VolumeControl) players[0].getControl("VolumeControl");
voc.setMute(true);
voc = (VolumeControl) players[1].getControl("VolumeControl");
voc.setMute(true);
VideoControl vic = (VideoControl) players[0].getControl("VideoControl");
vic.setDisplayLocation(0, 0);
vic = (VideoControl) players[1].getControl("VideoControl");
vic.setDisplayLocation(0, 100);
mc0.start();
mc1.start();
} catch (Exception e) {
e.printStackTrace();
}
}
}
The LoggingPlayerListener logs the events that occur.
When I execute this code on a Nokia N95 I get: Symbian OS error: -45 (What does this mean?)
When I execute this code on a Nokia 6500c I get: deviceUnavailable on the first player