Skip to content

Instantly share code, notes, and snippets.

@codeboxed
Created March 5, 2011 20:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeboxed/856675 to your computer and use it in GitHub Desktop.
Save codeboxed/856675 to your computer and use it in GitHub Desktop.
Example on how to set the file path for embedding videos on Mac OS X and Windows with Titanium
var filesPath = Titanium.API.application.dataPath +
Titanium.Filesystem.getSeparator();
var currentFile = 'file.mp4';
var filePath = null;
switch(Titanium.getPlatform()) {
// Apple
case 'osx':
filePath = "file:///" + filesPath + currentFile;
break;
// Windows
case 'win32':
filePath = "file:///" + filePath.replace(/\134/g,"/") + currentFile;
break;
}
// Embed file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment