CB-1206: file uri not handled correctly by Media Player

This commit is contained in:
macdonst 2012-08-08 15:33:01 -04:00
parent 5016253922
commit 9bac59b952

View File

@ -66,13 +66,13 @@ public class AudioHandler extends Plugin {
try { try {
if (action.equals("startRecordingAudio")) { if (action.equals("startRecordingAudio")) {
this.startRecordingAudio(args.getString(0), args.getString(1)); this.startRecordingAudio(args.getString(0), FileUtils.stripFileProtocol(args.getString(1)));
} }
else if (action.equals("stopRecordingAudio")) { else if (action.equals("stopRecordingAudio")) {
this.stopRecordingAudio(args.getString(0)); this.stopRecordingAudio(args.getString(0));
} }
else if (action.equals("startPlayingAudio")) { else if (action.equals("startPlayingAudio")) {
this.startPlayingAudio(args.getString(0), args.getString(1)); this.startPlayingAudio(args.getString(0), FileUtils.stripFileProtocol(args.getString(1)));
} }
else if (action.equals("seekToAudio")) { else if (action.equals("seekToAudio")) {
this.seekToAudio(args.getString(0), args.getInt(1)); this.seekToAudio(args.getString(0), args.getInt(1));
@ -97,10 +97,10 @@ public class AudioHandler extends Plugin {
return new PluginResult(status, f); return new PluginResult(status, f);
} }
else if (action.equals("create")) { else if (action.equals("create")) {
String id = args.getString(0); String id = args.getString(0);
String src = args.getString(1); String src = FileUtils.stripFileProtocol(args.getString(1));
AudioPlayer audio = new AudioPlayer(this, id, src); AudioPlayer audio = new AudioPlayer(this, id, src);
this.players.put(id, audio); this.players.put(id, audio);
} }
else if (action.equals("release")) { else if (action.equals("release")) {
boolean b = this.release(args.getString(0)); boolean b = this.release(args.getString(0));
@ -198,12 +198,12 @@ public class AudioHandler extends Plugin {
* @param file The name of the file * @param file The name of the file
*/ */
public void startRecordingAudio(String id, String file) { public void startRecordingAudio(String id, String file) {
AudioPlayer audio = this.players.get(id); AudioPlayer audio = this.players.get(id);
if ( audio == null) { if ( audio == null) {
audio = new AudioPlayer(this, id, file); audio = new AudioPlayer(this, id, file);
this.players.put(id, audio); this.players.put(id, audio);
} }
audio.startRecording(file); audio.startRecording(file);
} }
/** /**