Created
March 5, 2011 20:13
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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