【问题标题】:Videogular autoPlay error视频自动播放错误
【发布时间】:2015-04-08 22:43:24
【问题描述】:

大家好,我是第一次尝试设置我的 videogular。当我尝试将自动播放设置设置为 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>   

有什么我忽略的吗?真的不知道自己做错了什么。

【问题讨论】:

    标签: angularjs autoplay videogular


    【解决方案1】:

    我是 Videogular 的创建者。

    这是 Videogular 1.0.0 中的一个已知错误,我们希望在几周后为下一个版本修复它。

    这里是问题的链接,如果您想关注它:

    https://github.com/2fdevs/videogular/issues/161

    【讨论】:

    • 非常感谢。我会留意的。
    猜你喜欢
    • 1970-01-01
    • 2013-02-13
    • 2021-11-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多