2
嘿家伙我试图设置我的视频第一次。当我尝试设置自动播放设置为true,它抛出一个错误:视频自动播放错误
ReferenceError: VG_UTILS is not defined
at videogular.js:506
at angular.js:16210
at completeOutstandingRequest (angular.js:4902)
at angular.js:5282
我的控制器:
angular.module('app')
.controller('SectionVideoCtrl', ['$rootScope', '$scope', '$element', '$sce', function ($rootScope, $scope, $element, $sce) {
var _API = null;
$scope.stretchModes = [
{label: "None", value: "none"},
{label: "Fit", value: "fit"},
{label: "Fill", value: "fill"}
];
this.config = {
sources: [
{src: $sce.trustAsResourceUrl("video/" + "footy" + ".mp4"), type: "video/mp4"},
{src: $sce.trustAsResourceUrl("video/" + "footy" + ".webm"), type: "video/webm"},
{src: $sce.trustAsResourceUrl("video/" + "footy" + ".ogg"), type: "video/ogg"}
],
width: 640,
height: 360,
responsive: true,
autoPlay: true,
stretch: $scope.stretchModes[2],
theme: "css/plugins/videogular.min.css"
};
}]);
一切都装载到模块:
angular
.module('app', [
'ngRoute',
"ngSanitize",
"com.2fdevs.videogular",
"com.2fdevs.videogular.plugins.controls",
"com.2fdevs.videogular.plugins.overlayplay",
"com.2fdevs.videogular.plugins.buffering",
"com.2fdevs.videogular.plugins.poster"
])
和HTML:
<videogular vg-player-ready="controller.onPlayerReady($API)" vg-width="controller.config.width" vg-theme="controller.config.theme.url" vg-auto-play="controller.config.autoPlay">
<vg-media vg-src="controller.config.sources" vg-native-controls="false">
<video preload='metadata'></video>
</vg-media>
</videogular>
有没有somet兴我忽略了?真的不知道我做错了什么。
谢谢你这么多。我会密切关注它。 – Pieter 2015-02-10 03:20:42