User Tools

Site Tools


lmce_owncloud

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
lmce_owncloud [2014/06/09 21:12] adminlmce_owncloud [2014/06/10 11:47] (current) admin
Line 32: Line 32:
  
   vlc -vvv file:///mnt/device/61/sadasdasd.avi --sout="#transcode{vcodec=theo, vb=800, acodec=vorb, ab=128, scale=1, audio-sync, width=480, height=320}:std{access=http, mux=ogg, dst='192.168.1.210:9080/streaming/test/106.ogg' }"   vlc -vvv file:///mnt/device/61/sadasdasd.avi --sout="#transcode{vcodec=theo, vb=800, acodec=vorb, ab=128, scale=1, audio-sync, width=480, height=320}:std{access=http, mux=ogg, dst='192.168.1.210:9080/streaming/test/106.ogg' }"
 +  
 +===== Useful code for app development =====
 +==== PHP ====
 +
 +Add Settings in admin area (appinfo/app.php):
 +
 +<code php>
 +\OCP\App::registerAdmin('lmce_vdr', 'admin/settings');
 +</code>
 +
 +Get users ID:
 +
 +<code php>
 +OCP\User::getUser();
 +</code>
 +
 +Translate in Template
 +
 +<code php>
 +<?php echo $l->t('Channel manager'); ?>
 +</code>
 +
 +Check for logged in user:
 +
 +<code php>
 +OCP\JSON::checkLoggedIn();
 +</code>
 +
 +Check for enabled app:
 +
 +<code php>
 +OCP\JSON::checkAppEnabled('lmce_vdr');
 +</code>
 +==== Javascript ====
 +
 +Include JS (appinfo/app.php):
 +
 +<code php>
 +OCP\Util::addscript('lmce_vdr','script');
 +</code>
 +
 +Includes file app_folder/js/script.js
 +
 +Translate:
 +
 +<code javascript>
 +t('appname','text to translate');
 +</code>
 +
 +Select a File:
 +
 +<code javascript>
 +OC.dialogs.filepicker('test', function(val) {console.log(val)}, true, null, true);
 +</code>
 +
 +AJAX URL:
 +
 +<code javascript>
 +OC.filePath('lmce_vdr','ajax','moveChannel.php'),
 +</code>
 +
 +Example AJAX request:
 +
 +<code javascript>
 +$.ajax({
 + // REQUEST URL
 + url: OC.filePath('lmce_vdr','ajax','action.php'),
 + type: "post",
 + // URL PARAMS
 + data: { action: action},
 + success: function(data){
 + // DO SOMETHING WITH data
 + },
 + error: function(data){
 + alert('Error running action ...');
 + },
 +});
 +</code>
 +
 +==== CSS ====
 +
 +
 +Include CSS (appinfo/app.php):
 +
 +<code php>
 +OCP\Util::addStyle("lmce_vdr", "style");
 +</code>
 +
 +Includes file app_folder/css/style.css
 +
 +
 +Get file app folder using **%appswebroot%**:
 +
 +<code css>
 +#someId {
 +  background:url(%appswebroot%/lmce_vdr/img/textfield-rename.png)
 +}
 +</code>
 +
 +Good to know vars in JS:
 +
 +<code javascript>0
 +oc_debug=false;
 +oc_webroot="/userspace";
 +oc_appswebroots={"files":"/userspace/apps/files","activity":"/userspace/apps/activity","calendar":"/userspace/apps/calendar","contacts":"/userspace/apps/contacts"}datepickerFormatDate="dd.mm.yy";
 +dayNames=["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"];
 +var monthNames=["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"];
 +var firstDay=0;
 +var oc_config={"session_lifetime":"144000","session_keepalive":true};
 +</code>
lmce_owncloud.1402348372.txt.gz · Last modified: 2014/06/09 21:12 by admin