0

如何将我的视频源(srcVideo)传递给 videoDetailsform.VideoUrl 中的 ng-init?

视频.html

<input ng-model="videoDetailsform.title" class="form-control input-default" ng-modal="form.vid_Title"   placeholder="Video Title." ng-init="videoDetailsform.title=''">
<video  placeholder="Drop Video Here" width="100%" ng-drop="true" ng-drop-success="objectDropped()" id="myVideo" >
   <source id="mp4Source" ng-src={{srcVideo}} type="video/mp4">
   <source id="webmSource" ng-src={{srcVideo}} type="video/Webm">    
</video>

<input type="hidden" ng-model="videoDetailsform.title" ng-init="videoDetailsform.title='{{form.vid_Title}}'">   
<input type="hidden" ng-model="videoDetailsform.VideoUrl" ng-init="videoDetailsform.VideoUrl=srcVideo"> 

视频控制器.js

在这个文件中,我将所有视频信息推送到videoCs['VideoDetails']并使用myService.js方法createJsonFormatter()来保存它。

videoCs['VideoDetails'] = [];
$scope.saveDraft = function(){
    videoCs['VideoDetails'].push($scope.videoDetailsform);
    saveData.createJsonFormatter(JSON.stringify(videoCs));
};

我的服务.js

videoCourseApp.service('saveData', function(fileSystem){
this.createJsonFormatter = function(data){

    console.log(data);
    var txtFileName = "videos.json";
    fileSystem.writeText(txtFileName, data).then(function(fs) {
        console.log('success');
    }, function(err) {
        console.log(err);
    });
};
});

我正在从输入类型获取数据,但无法获取视频源。

4

0 回答 0