Menu

#172 read a smil file with java on a mobile

open
nobody
None
5
2010-02-17
2010-02-17
No

Hi all,

I'm now working on a project that aim to developp a java program that can read a smil file

I have tread with th program presented in this page: http://www.xsmiles.org/xsmiles_smil.html
// Import the JSMILPlayer
import fi.hut.tml.xsmiles.mlfc.smil.viewer.swing.JSMILPlayer;

import javax.swing.JFrame;
import java.awt.BorderLayout;

public class SMILApp {

/**
* Main to play a SMIL presentation.
*/
public static void main(String[] args) {

String filename = null;

// Get the filename
if (args.length > 0) {
filename = args[0];
} else
filename = "here i put the path of the file on the discl";

System.out.println("SMILApp playing '"+filename);

// Create the SMIL player
JSMILPlayer smil = new JSMILPlayer();

// Initialize with the filename (could also be URL)
if (smil.init(filename) == false)
System.out.println("ERROR initializing "+filename);

// Create a frame and add the SMIL component to it
JFrame frame = new JFrame("Simple SMIL player");
frame.setSize(600,400);
frame.getContentPane().add(smil, BorderLayout.CENTER);
frame.show();

// Start the SMIL presentation
smil.start();

// Wait for 10 seconds
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
}

System.out.println("SMILApp stopping.");

// Stop the SMIL presentation
smil.stop();

// Remove the SMIL component from the frame
frame.removeAll();
frame.hide();

// Free memory
smil.destroy();

// Clear variables
frame = null;
smil = null;

// Exit
System.exit(0);
}
}

Unfortunatly an error occur when runing:

Error intializing +filename

Although i have ad all the necessary libraries.

Please can any one help me, i will be grateful it's a bit urgent

All the best

Discussion


Log in to post a comment.

Auth0 Logo