summaryrefslogtreecommitdiff
path: root/src/standards/Tizen/Mediacontent/JSVideo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/standards/Tizen/Mediacontent/JSVideo.cpp')
-rwxr-xr-xsrc/standards/Tizen/Mediacontent/JSVideo.cpp45
1 files changed, 43 insertions, 2 deletions
diff --git a/src/standards/Tizen/Mediacontent/JSVideo.cpp b/src/standards/Tizen/Mediacontent/JSVideo.cpp
index 0e6e57a..5e6b6d8 100755
--- a/src/standards/Tizen/Mediacontent/JSVideo.cpp
+++ b/src/standards/Tizen/Mediacontent/JSVideo.cpp
@@ -39,6 +39,8 @@
#define TIZEN_MEDIACONTENT_VIDEO_HEIGHT "height"
using namespace TizenApis::Tizen1_0::Tizen;
+using namespace TizenApis::Commons;
+using namespace WrtDeviceApis::Commons;
namespace TizenApis {
namespace Tizen1_0 {
@@ -166,6 +168,35 @@ JSValueRef JSVideo::getPropertyGeoLocation(
return JSValueMakeUndefined(context);
}
+bool JSVideo::setPropertyGeoLocation(
+ JSContextRef context,
+ JSObjectRef object,
+ JSStringRef propertyName,
+ JSValueRef value,
+ JSValueRef* exception)
+{
+ LogDebug("entered");
+ Try
+ {
+ Converter converter(context);
+ MediacontentVideoPtr video = getVideoObject(object);
+
+ TizenApis::Api::Tizen::SimpleCoordinatesPtr geoLocation =
+ TizenApis::Tizen1_0::Tizen::JSSimpleCoordinates::getSimpleCoordinates(context, value);
+
+ video->setVideoLatitude(geoLocation->getLatitude());
+ video->setVideoLongitude(geoLocation->getLongitude());
+
+ return true;
+ }
+ Catch(Exception)
+ {
+ LogWarning("trying to get incorrect value");
+ return JSTizenExceptionFactory::postException(context, exception, JSTizenException::TYPE_MISMATCH_ERROR);
+ }
+ return JSValueMakeUndefined(context);
+}
+
JSValueRef JSVideo::getPropertyAlbum(
JSContextRef context,
@@ -365,8 +396,9 @@ bool JSVideo::setPropertyPlayCount(
{
Converter converter(context);
MediacontentVideoPtr video = getVideoObject(object);
- int rating = converter.toInt(value);
- video->setVideoPlayCount(rating, true);
+ int count = converter.toInt(value);
+ LogDebug("count:" << count);
+ video->setVideoPlayCount(count, true);
return true;
}
Catch(Exception)
@@ -394,6 +426,9 @@ bool JSVideo::setPropertyArtists(
vector<std::string> artists;
if (!JSValueIsNull(context, value)) {
+
+ if (JSIsArrayValue(context, value))
+ {
JSObjectRef jsObject = converter.toJSObjectRef(value);
for (std::size_t i = 0; i < JSGetArrayLength(context, jsObject); ++i) {
@@ -401,6 +436,12 @@ bool JSVideo::setPropertyArtists(
artists.push_back(converter.toString(element));
}
}
+ else
+ {
+ TizenApis::Commons::JSTizenExceptionFactory::postException(context, exception, TizenApis::Commons::JSTizenException::TYPE_MISMATCH_ERROR);
+ return false;
+ }
+ }
video->setVideoArtist(artists, true);
return true;
}