From 32823eec2aba6888da89350a7db5fe9136939279 Mon Sep 17 00:00:00 2001
From: Pawel Andruszkiewicz
Date: Thu, 7 Apr 2016 14:27:51 +0200
Subject: [PATCH] [Media] Code structure changed to match cordova architecture.
Change-Id: Id08058932daaa612b887badf48aa498e942bec4b
Signed-off-by: Pawel Andruszkiewicz
---
src/cordova-api.gyp | 1 -
src/lib/cordova_plugins.js | 5 +++
.../cordova-plugin-media/tizen/Media.js} | 4 --
src/media/cordova_media.gyp | 25 ------------
src/media/cordova_media_extension.cc | 39 -------------------
src/media/cordova_media_extension.h | 36 -----------------
6 files changed, 5 insertions(+), 105 deletions(-)
rename src/{media/cordova_media_api.js => lib/plugins/cordova-plugin-media/tizen/Media.js} (99%)
delete mode 100644 src/media/cordova_media.gyp
delete mode 100755 src/media/cordova_media_extension.cc
delete mode 100755 src/media/cordova_media_extension.h
diff --git a/src/cordova-api.gyp b/src/cordova-api.gyp
index 8b1b5f2..af8643b 100644
--- a/src/cordova-api.gyp
+++ b/src/cordova-api.gyp
@@ -12,7 +12,6 @@
'file/cordova_file.gyp:*',
'globalization/cordova_globalization.gyp:*',
'networkinformation/cordova_networkinformation.gyp:*',
- 'media/cordova_media.gyp:*',
],
},
], # end targets
diff --git a/src/lib/cordova_plugins.js b/src/lib/cordova_plugins.js
index a19039e..9d4303a 100644
--- a/src/lib/cordova_plugins.js
+++ b/src/lib/cordova_plugins.js
@@ -266,6 +266,11 @@ module.exports = [
"clobbers": [
"window.Media"
]
+ },
+ {
+ "file": "plugins/cordova-plugin-media/tizen/Media.js",
+ "id": "cordova-plugin-media.tizen.Media",
+ "runs": true
}
];
module.exports.metadata =
diff --git a/src/media/cordova_media_api.js b/src/lib/plugins/cordova-plugin-media/tizen/Media.js
similarity index 99%
rename from src/media/cordova_media_api.js
rename to src/lib/plugins/cordova-plugin-media/tizen/Media.js
index d7aa46b..0f29b19 100755
--- a/src/media/cordova_media_api.js
+++ b/src/lib/plugins/cordova-plugin-media/tizen/Media.js
@@ -419,8 +419,4 @@ console.log('Loaded cordova.media API');
// TODO: remove when added to public cordova repository -> begin
});
-
-exports = function(require) {
- require('cordova-tizen').addPlugin('cordova-plugin-media.Media', plugin_name, 'runs');
-};
// TODO: remove -> end
diff --git a/src/media/cordova_media.gyp b/src/media/cordova_media.gyp
deleted file mode 100644
index 4a43c14..0000000
--- a/src/media/cordova_media.gyp
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- 'includes':[
- '/usr/include/webapi-plugins/src/common/common.gypi',
- ],
- 'targets': [
- {
- 'target_name': 'tizen_cordova_media',
- 'type': 'loadable_module',
- 'sources': [
- 'cordova_media_api.js',
- 'cordova_media_extension.cc',
- 'cordova_media_extension.h',
- ],
- 'include_dirs': [
- '../',
- '<(SHARED_INTERMEDIATE_DIR)',
- ],
- 'variables': {
- 'packages': [
- 'webapi-plugins',
- ],
- },
- },
- ],
-}
diff --git a/src/media/cordova_media_extension.cc b/src/media/cordova_media_extension.cc
deleted file mode 100755
index 6565afc..0000000
--- a/src/media/cordova_media_extension.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "media/cordova_media_extension.h"
-
-// This will be generated from cordova_media_api.js
-extern const char kSource_cordova_media_api[];
-
-common::Extension* CreateExtension() {
- return new extension::cordova::media::CordovaMediaExtension();
-}
-
-namespace extension {
-namespace cordova {
-namespace media {
-
-CordovaMediaExtension::CordovaMediaExtension() {
- SetExtensionName("tizen.cordova.media");
- SetJavaScriptAPI(kSource_cordova_media_api);
-}
-
-CordovaMediaExtension::~CordovaMediaExtension() {}
-
-} // media
-} // cordova
-} // extension
diff --git a/src/media/cordova_media_extension.h b/src/media/cordova_media_extension.h
deleted file mode 100755
index 3db047c..0000000
--- a/src/media/cordova_media_extension.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef CORDOVA_MEDIA_MEDIA_EXTENSION_H_
-#define CORDOVA_MEDIA_MEDIA_EXTENSION_H_
-
-#include "common/extension.h"
-
-namespace extension {
-namespace cordova {
-namespace media {
-
-class CordovaMediaExtension : public common::Extension {
- public:
- CordovaMediaExtension();
- virtual ~CordovaMediaExtension();
-};
-
-} //media
-} //cordova
-} //extension
-
-#endif // CORDOVA_MEDIA_MEDIA_EXTENSION_H_
--
2.34.1