Main.java
import javax.media.Player;
import javax.tv.service.selection.ServiceContentHandler;
import javax.tv.service.selection.ServiceContextFactory;
import javax.tv.service.selection.ServiceMediaHandler;
import javax.tv.xlet.Xlet;
import javax.tv.xlet.XletContext;
import org.bluray.ti.selection.TitleContext;
public class Main implements Xlet{
XletContext xc;
public void initXlet(XletContext xc){
try {
Player p = null;
// Title Contextの取得
ServiceContextFactory scf = ServiceContextFactory.getInstance();
TitleContext tc = (TitleContext)scf.getServiceContext(xc);
ServiceContentHandler[] schs = tc.getServiceContentHandlers();
for( int i = 0; i < schs.length; i++ ){
if (schs[i] instanceof ServiceMediaHandler) {
// JMF Playerの取得
p = (ServiceMediaHandler)schs[i];
break;
}
}
if( p != null ){
Thread.sleep(2000);
p.setRate(0f);
Thread.sleep(2000);
p.setRate(1f);
Thread.sleep(2000);
p.stop();
}
} catch (Throwable thr){
}
}
public void startXlet(){}
public void pauseXlet(){ }
public void destroyXlet(boolean unconditional){}
}