define(function(require,exports,module){const DocumentManager=require("document/DocumentManager"),MediaViewTemplate=require("text!htmlContent/media-view.html"),ProjectManager=require("project/ProjectManager"),LanguageManager=require("language/LanguageManager"),MainViewFactory=require("view/MainViewFactory"),Strings=require("strings"),StringUtils=require("utils/StringUtils"),FileSystem=require("filesystem/FileSystem"),FileSystemError=require("filesystem/FileSystemError"),FileUtils=require("file/FileUtils"),_=require("thirdparty/lodash"),Mustache=require("thirdparty/mustache/mustache"),_viewers={},_MIME_TYPES={mp4:"video/mp4",m4v:"video/mp4",webm:"video/webm",mkv:"video/webm",ogv:"video/ogg",mov:"video/quicktime",mp3:"audio/mpeg",wav:"audio/wav",ogg:"audio/ogg",m4a:"audio/mp4",flac:"audio/flac",aac:"audio/aac",aif:"audio/aiff",aiff:"audio/aiff"};function _getMimeType(fullPath,isAudio){const extension=FileUtils.getFileExtension(fullPath).toLowerCase();return _MIME_TYPES[extension]||(isAudio?"audio/mpeg":"video/mp4")}function _canStreamMedia(){return!!(Phoenix.isNativeApp&&window.isNodeReady&&window.PhNodeEngine&&window.PhNodeEngine.mediaURL)}function _mediaStreamURL(file){const platformPath=Phoenix.fs.getTauriPlatformPath(file.fullPath);return window.PhNodeEngine.mediaURL+"/"+encodeURIComponent(file.name)+"?platformPath="+encodeURIComponent(platformPath)}function _mediaToDataURI(file,isAudio,cb){file.read({encoding:window.fs.BYTE_ARRAY_ENCODING},function(err,content){if(err)return void cb(err);const bytes=new Uint8Array(content),chunkSize=32768,chunks=[];for(let i=0;i