![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
cordova-plugin-pixlive
Advanced tools
This allows a seamless bridge for using Augmented Reality PixLive SDK into your own Cordova application.
Check https://www.vidinoti.com/ for more information and https://vidinoti.github.io/ for the complete documentation.
VDARSDK.xcframework
file path and the license key to the plugin installation command line:cordova plugin add cordova-plugin-pixlive@latest --variable LICENSE_KEY=MyLicenseKey --variable PIXLIVE_SDK_IOS_LOCATION=\"path/to/VDARSDK.xcframework\"
The best way to start developing your app is with a simple example. This demo app shows you the basis for using PixLive SDK in your cordova project.
cordova create myArApp com.mycompany.myArApp myArApp --template git://github.com/vidinoti/cordova-template-PixLive.git
cd myArApp
cordova platform add android
cordova platform add ios
VDARSDK.xcframework
file path and the license key to the plugin installation command line:cordova plugin add cordova-plugin-pixlive@latest --variable LICENSE_KEY=MyLicenseKey --variable PIXLIVE_SDK_IOS_LOCATION=\"path/to/VDARSDK.xcframework\"
cordova build android
cordova build ios
cordova run android
//Synchronize the app with PixLive Maker http://pixlivemaker.com
if (window.cordova && window.cordova.plugins && window.cordova.plugins.PixLive) {
// You can pass an array of tags to synchronize with specific tags: synchronize(['test1','test2'])
cordova.plugins.PixLive.synchronize([], synchSuccessListener, synchErrorListener);
}
/**
* Example of arView size
* @return {number[]} [screenWidth,screenHeight]
*/
getArViewSize = function() {
if(window.orientation == 90 || window.orientation == -90) {
if(window.screen.height > window.screen.width) {
return [window.screen.height, window.screen.width];
}
}
return [window.screen.width, window.screen.height];
};
if (window.cordova && window.cordova.plugins && window.cordova.plugins.PixLive) {
var arViewSize = getArViewSize();
var arView = cordova.plugins.PixLive.createARView(0, 0, arViewSize[0], arViewSize[1]);
}
When the AR view is created, it is created behind the current application page (see illustration below). This allows the application to display content on top of the AR view.
However the area of the HTML page overlapping the AR view must be transparent (CSS: background-color: transparent
) otherwise the AR view is not visible.
If you don't see the AR view, ensure that the DOM element (and it parents) hiding the AR view are all transparent.
/**
* onOrientationchange Event listener
*/
onOrientationchange = function() {
if(arView) {
var screenSize = getSize();
arView.resize(0, 0, screenSize[0], screenSize[1]);
}
};
window.addEventListener("orientationchange", onOrientationchange, false);
if(arView) {
arView.beforeLeave();
arView.afterLeave();
}
if(arView) {
arView.beforeEnter();
onOrientationchange();
arView.afterEnter();
}
//event listeners for pixlive events
var pxlEventListeners={};
//Event handler for pixlive events
var pxlEventHandler = function(event) {
if(event.type && pxlEventListeners[event.type]) {
for(var i = pxlEventListeners[event.type].length-1; i>=0; i--) {
pxlEventListeners[event.type][i](event);
}
}
};
/**
* Add a new listener for the provided event type.
* @param {string} event The event to register for.
* @param {function} callback The function to be called when the provided event is generated.
*/
addListener = function(event, callback) {
if(!pxlEventListeners[event]) {
pxlEventListeners[event]=[];
}
pxlEventListeners[event].push(callback);
}
//register pxlEventHandler
if (window.cordova && window.cordova.plugins && window.cordova.plugins.PixLive && !window.cordova.plugins.PixLive.onEventReceived) {
cordova.plugins.PixLive.onEventReceived = pxlEventHandler;
}
PixLive events are:
enterContext
- triggered when entering a context (image recognition, beacon detection, etc.)exitContext
- triggered when exiting the context.codeRecognize
- triggered when a QR code is recognized. It contains the content of the QR code.presentAnnotations
- triggered when an AR content is displayed.hideAnnotations
- triggered when the AR content is hidden.requireSync
- triggered when a context asks for a new synchronization with some tags (See "Synchronization trigger" in PixLive Maker).sensorTriggered
- triggered when a sensor has been triggered (image detection, beacon detection). The event is triggered even if the context does not contain any content.sensorUpdate
- triggered when a sensor value is updated (e.g. beacon distance).sensorUntriggered
- triggered when a sensor is untriggered.eventFromContent
- triggered when a content sends an event to the application (e.g. if a coupon content is opened, the coupon id is sent via this callback).localizationUpdate
- a new localization is received, this will be called only after starting the localizationManager (startNearbyGPSDetection starts it).newNearbyGPSPoints
- new nearby gps points are available, this will be called only after calling startNearbyGPSDetection.For example:
//enable PixLive SDK to catch the touch event when a content is displayed
addListener("presentAnnotations",function(event){
arView.enableTouch();
});
//disable PixLive SDK to catch the touch event when a content is hidden
addListener("hideAnnotations",function(event){
arView.disableTouch();
});
//take action when a QR code is recognized by the SDK
addListener("codeRecognize",function(event){
alert("QR code recognized: " + event.code);
});
plugin.xml
and package.json
Publish a new release in npm registry:
npm login
npm publish
Do not use this release, update to 1.22.1
VDARSDK.xcframework
instead of VDARSDK.framework
)requires Vidinoti SDK >= 7.2.9
stopContext
requires Vidinoti SDK >= 6.5.14
setInterfaceLanguage
for changing the SDK languagerequires Vidinoti SDK >= 6.5.12
updateTagMapping
and enableContextsWithTags
Q
by native promise for Cordova 9.requires PixLive SDK >= 6.5.5
requires Vidinoti SDK >= 6.4.0
requires PixLive SDK >= 6.3.0
PixLive.synchronizeWithToursAndContexts
)requires PixLive SDK >= 6.2.0
PixLive.synchronizeWithTours
)FAQs
PixLive SDK plugin for Cordova based hybrid apps
The npm package cordova-plugin-pixlive receives a total of 11 weekly downloads. As such, cordova-plugin-pixlive popularity was classified as not popular.
We found that cordova-plugin-pixlive demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.