Skip to content

Commit

Permalink
alert on vlc error
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabor Csomak committed Aug 21, 2014
1 parent a33f2a1 commit b6cba28
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/components/fileList/MainView.mxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import movieServices.OmdbApi;
import mx.controls.Alert;
import mx.events.FileEvent;
import mx.events.FlexEvent;
Expand All @@ -37,6 +39,16 @@
isCreated = true;
}
public function alert(text:String = "", title:String = "",
flags:uint = 0x4 /* Alert.OK */,
parent:Sprite = null,
closeHandler:Function = null,
iconClass:Class = null,
defaultButtonFlag:uint = 0x4 /* Alert.OK */,
moduleFactory:IFlexModuleFactory = null):Alert {
return Alert.show(text, title, flags, parent, closeHandler, iconClass, defaultButtonFlag, moduleFactory );
}
public function openFile(file:File):void {
file.openWithDefaultApplication();
IWatchSeriez.CONTEXT.fileMetaDB.getMeta(file.nativePath).icon = IconClasses.questionIconName;
Expand Down
13 changes: 12 additions & 1 deletion src/utils/VLCManager.as
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ public class VLCManager {
protected var mediaPlayer:File;
protected var nativeProcessStartupInfo:NativeProcessStartupInfo;

[Bindable]
public function get vlcAvailable():Boolean {
return mediaPlayer && NativeProcess.isSupported;
}

public function VLCManager() {
mediaPlayer = new File();
mediaPlayer = mediaPlayer.resolvePath(VLC_PATH); //TODO settings
try {
mediaPlayer = mediaPlayer.resolvePath(VLC_PATH); //TODO settings
} catch (e:Error) {
IWatchSeriez.CONTEXT.mainView.alert("Couldn't resolve VLC path. Should be at " + VLC_PATH, "Error opening VLC");
//TODO handle this. settings, mac
return;
}
if (NativeProcess.isSupported) {
nativeProcessStartupInfo = new NativeProcessStartupInfo();
nativeProcessStartupInfo.executable = mediaPlayer;
Expand Down

0 comments on commit b6cba28

Please sign in to comment.