Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/files_videoplayer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2020-07-23 09:00:48 +0300
committerGitHub <noreply@github.com>2020-07-23 09:00:48 +0300
commitdfcd96566ae76fe0e3961a15632652f75555eb61 (patch)
tree69f3a6eab54307c4b7885fcc761880474742c8ed
parent56ac27be1e2df6633c93a72d20cee962b59b4a95 (diff)
parent4c79f4d46406d01c0fb0291e0abc5c25b6bc1819 (diff)
Merge pull request #176 from nextcloud/techdebt/noid/bootstrap
Use IBootstrap for the app
-rwxr-xr-xappinfo/app.php24
-rwxr-xr-xappinfo/info.xml1
-rw-r--r--lib/AppInfo/Application.php41
3 files changed, 42 insertions, 24 deletions
diff --git a/appinfo/app.php b/appinfo/app.php
deleted file mode 100755
index 4899266..0000000
--- a/appinfo/app.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-/**
-* VideoJS Sublime
-*
-* @author Björn Korella
-*
-* The MIT License (MIT)
-*
-* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-*
-* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-*
-* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*
-*/
-
-OCP\Util::addscript( 'files_videoplayer', 'main');
-
-$csp = new \OCP\AppFramework\Http\ContentSecurityPolicy();
-$csp->addAllowedWorkerSrcDomain('\'self\'');
-$csp->addAllowedWorkerSrcDomain('blob:');
-$cspManager = \OC::$server->query(\OCP\Security\IContentSecurityPolicyManager::class);
-$cspManager->addDefaultPolicy($csp);
diff --git a/appinfo/info.xml b/appinfo/info.xml
index 1f2e9a8..e115153 100755
--- a/appinfo/info.xml
+++ b/appinfo/info.xml
@@ -13,6 +13,7 @@
<version>1.9.0</version>
<licence>MIT</licence>
<author>Björn Korella</author>
+ <namespace>FilesVideoPlayer</namespace>
<default_enable/>
<documentation>
<user>https://github.com/nextcloud/files_videoplayer/blob/master/README.md</user>
diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php
new file mode 100644
index 0000000..9165050
--- /dev/null
+++ b/lib/AppInfo/Application.php
@@ -0,0 +1,41 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * @copyright 2020 Morris Jobke <hey@morrisjobke.de>
+ *
+ * @author Morris Jobke <hey@morrisjobke.de>
+ *
+ * @license MIT
+ */
+
+namespace OCA\FilesVideoPlayer\AppInfo;
+
+use OCP\AppFramework\App;
+use OCP\AppFramework\Bootstrap\IBootContext;
+use OCP\AppFramework\Bootstrap\IBootstrap;
+use OCP\AppFramework\Bootstrap\IRegistrationContext;
+use OCP\AppFramework\Http\ContentSecurityPolicy;
+use OCP\Security\IContentSecurityPolicyManager;
+use OCP\Util;
+
+class Application extends App implements IBootstrap {
+ public const APP_ID = 'files_videoplayer';
+
+ public function __construct() {
+ parent::__construct(self::APP_ID);
+ }
+
+ public function register(IRegistrationContext $context): void {
+ }
+
+ public function boot(IBootContext $context): void {
+ Util::addScript('files_videoplayer', 'main');
+
+ $csp = new ContentSecurityPolicy();
+ $csp->addAllowedWorkerSrcDomain('\'self\'');
+ $csp->addAllowedWorkerSrcDomain('blob:');
+ $cspManager = $context->getServerContainer()->query(IContentSecurityPolicyManager::class);
+ $cspManager->addDefaultPolicy($csp);
+ }
+}