Как в vuforia при захвате изображения воспроизвести несколько видео привязанные к этим изображениям на cordova.apache это не Unity 3D

Всем здравствуйте, такой вопрос, есть ли возможность в кроссплатформенном приложении и плагина cordova-plugin-vuforia воспроизвести несколько видео привязанные к картинкам, на Unity3D это можно сделать там все хорошо, а вот на кордове.апач в js я никак не могу понять как это реализовать. Картинки добавленные в массив распознаются, (сделал по шаблону самого плагина), одно видео работает а вот как остальные 9 видео привязать к 9и картинкам... тупик, не знаю что сделать. Установил плагины cordova

  • com.moust.cordova.videoplayer
  • cordova-plugin-camera
  • cordova-plugin-vuforia
  • и др. для работы приложения Заранее спасибо всем, сразу скажу что учусь методом проб и ошибок :) Вот код, создал файл vuforia.js и прицепил к индексному файлу:

 var app = {
    // Vuforia license
    vuforiaLicense: 'тут лицензия от vuforiadeveloper',
    // Are we launching Vuforia with simple options?
    simpleOptions: null,
    // Which images have we matched?
    matchedImages: [],
    // Application Constructor
    initialize: function() {
        this.bindEvents();
    },
    // Bind Event Listeners
    //
    // Bind any events that are required on startup. Common events are:
    // 'load', 'deviceready', 'offline', and 'online'.
    bindEvents: function() {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },
    // deviceready Event Handler
    //
    // The scope of 'this' is the event. In order to call the 'receivedEvent'
    // function, we must explicitly call 'app.receivedEvent(...);'
    onDeviceReady: function() {
        app.receivedEvent('deviceready');
    },
    
    // Update DOM on a Received Event
    receivedEvent: function(id) {
        // Start Vuforia using simple options
        document.getElementById('start-vuforia').onclick = function () {
            app.startVuforia(true);
        };


        // Attempt to stop Vuforia
        document.getElementById('stop-vuforia').onclick = function () {
            app.stopVuforia();
        }; 
    },


    // Start the Vuforia plugin
    updateVuforiaTargets: function(simpleOptions, successCallback, overlayMessage, targets){
        var options;

        if(typeof overlayMessage == 'undefined')
            overlayMessage = 'Наведите камеру на изображение...';

        if(typeof targets == 'undefined')
            targets = ['1_kartinka', '2_kartinka', '3_kartinka', '4_kartinka',  '5_kartinka', '6_kartinka', '7_kartinka', '8_kartinka', '9_kartinka', '10_kartinka'];

        // Reset the matched images
        app.matchedImages = [];

        // Set the global simpleOptions flag
        app.simpleOptions = simpleOptions;

        // Log out wether or not we are using simpleOptions
        //console.log('Simple options: '+!!app.simpleOptions);

        // Load either simple, or full options
        if(!!app.simpleOptions){
            options = {
                databaseXmlFile: 'www/targets/MikApp.xml',
                targetList: targets,
                vuforiaLicense: app.vuforiaLicense,
                overlayMessage: overlayMessage,
                showDevicesIcon: true,
                showAndroidCloseButton: true,
                autostopOnImageFound: true
            };
        }

        // Start Vuforia with our options
        navigator.VuforiaPlugin.updateVuforiaTargets(
            ['5_drujba']
            successCallback || app.vuforiaMatch,
            function(data) {
                alert("Error: " + data);
            }
            );
        },

        vuforiaMatch: function(data) {
        // To see exactly what `data` can contain, see 'Success callback `data` API' within the plugin's documentation.
        //console.log(data);

        // Have we found an image?
        if(data.status.imageFound) {
            // If we are using simple options, alert the image name
            if(app.simpleOptions) 
            {
               app.playVideo_1();
            }
        }
        // Are we manually closing?
        else if (data.status.manuallyClosed) {
            // Let the user know they've manually closed Vuforia
            alert("User manually closed Vuforia!");

            // If we've matched any images, tell the user what we found
            if(app.matchedImages.length){
                alert("Found:\n"+app.matchedImages);
            }
        }
    },
    // Stop the Vuforia plugin
    stopVuforia: function(){
        navigator.VuforiaPlugin.stopVuforia(function (data) {
            console.log(data);

            if (data.success == 'true') {
                alert('TOO SLOW! You took too long to find an image.');
            } else {
                alert('Couldn\'t stop Vuforia\n'+data.message);
            }
        }, function (data) {
            console.log("Error stopping Vuforia:\n"+data);
        });
    },
    
    playVideo_1: function(data) {
                // Where are we playing the sound from?
                VideoPlayer.play( "тут-ссылка-на-видео/video.mp4", {
                    volume: 0.5,
                    scalingMode: VideoPlayer.SCALING_MODE.SCALE_TO_FIT_WITH_CROPPING
                },
                function () {
                    console.log("video completed");
                },
                function (err) {
                    console.log(err);
                })
            }

        }

        app.initialize();


Ответы (0 шт):