Home How can I send Global varibale data from view to controller?
Reply: 0

How can I send Global varibale data from view to controller?

user1758
1#
user1758 Published in April 21, 2018, 3:27 pm

I have my Angular view file like below.

<!DOCTYPE html>

<video id="myVideo" class="video-js vjs-default-skin"></video>
<script>
  var dataUri;
  var videoData;
    var player = videojs("myVideo", {
    controls: true,
    width: 320,
    height: 240,
    fluid: false,
    plugins: {
        record: {
            audio: true,
            video: true,
            maxLength: 100,
            debug: true
        }
    }
}, function(){
    // print version information at startup
    videojs.log('Using video.js', videojs.VERSION,
        'with videojs-record', videojs.getPluginVersion('record'),
        'and recordrtc', RecordRTC.version);
});
// error handling
player.on('deviceError', function() {
    console.log('device error:', player.deviceErrorCode);
});
player.on('error', function(error) {
    console.log('error:', error);
});
// user clicked the record button and started recording
player.on('startRecord', function() {
    console.log('started recording!');
});
// user completed recording and stream is available
player.on('finishRecord', function() {
    console.log('player : ', player.recordedData.video.name);
    videoData = player.recordedData;
    console.log('finished recording: ', player.recordedData);
}

);


function getVideoData()
{
    return videoData;
}
</script>
<button id="record" onClick="getVideoData();" ng-model="onFileSelect()"></button>

When player.on('finishRecord', function() function is called it will have the recorded video data in player.recordedData variable. What My problem is, I want to send the player.recordedData to the angular controller on button click whose id is record.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.298338 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO