javascript - Videogular Not Loading - Stack Overflow

I'm trying to implement Videogular in my website, but without all the stuff that es with downloadi

I'm trying to implement Videogular in my website, but without all the stuff that es with downloading the GitHub project. I want to only use videogular.js, the plugins, and the default theme. When I load the page however, its the default HTML5 video player and Videogular is not implemented.

My html code looks like:

<html ng-app="myapp">
    <head>
        <script src="angular.min.js"></script>
        <script src="jquery-2.0.3.min.js"></script>
        <script src="videogular/videogular.js"></script>
        <script src="videogular/plugins/controls.js" type="text/javascript"></script>
        <script src="videogular/plugins/overlay-play.js" type="text/javascript"></script>
        <script src="videogular/plugins/buffering.js" type="text/javascript"></script>
        <script src="videogular/plugins/poster.js" type="text/javascript"></script>
        <script src="videoserve.js"></script>
        <link rel="stylesheet" type="text/css" href="test.css">
    </head>
    <body ng-controller="MyController">
        <div id="videoDiv">
            <videogular vg-responsive="config.responsive" vg-autoPlay="config.autoPlay">
                <video class='videoPlayer' controls preload='metadata'>
                    <source src='assets/videos/Test 1080p HD.mp4' type='video/mp4'>
                </video>
                <vg-poster-image vg-url='config.plugins.poster.url' vg-stretch="config.stretch.value"></vg-poster-image>
                <vg-buffering></vg-buffering>
            </videogular>
        </div>
    </body>
</html>

And my js file looks like:

var app = angular.module('myapp', [
]);

app.controller('MyController', function($scope) {
    $scope.stretchModes = [
        {label: "None", value: "none"},
        {label: "Fit", value: "fit"},
        {label: "Fill", value: "fill"}
    ];

    $scope.config = {
        width: 740,
        height: 380,
        autoHide: false,
        autoPlay: true,
        responsive: false,
        stretch: $scope.stretchModes[0],
        transclude: true,
        theme: {
                url: "videogular/default/videogular.css",
                playIcon: "&#xe000;",
                pauseIcon: "&#xe001;",
                volumeLevel3Icon: "&#xe002;",
                volumeLevel2Icon: "&#xe003;",
                volumeLevel1Icon: "&#xe004;",
                volumeLevel0Icon: "&#xe005;",
                muteIcon: "&#xe006;",
                enterFullScreenIcon: "&#xe007;",
                exitFullScreenIcon: "&#xe008;"
            },
        plugins: {
            poster: {
                url: "assets/images/logo.png"
            }
        }
    };
});

I don't really see anything that I'm missing. I have the config object in the scope and a theme set (which apparently is mandatory). Does anyone see something that I can't?

EDIT: Never mind, turns out I forgot to include ngSantize and it's js file to my html header.

I'm trying to implement Videogular in my website, but without all the stuff that es with downloading the GitHub project. I want to only use videogular.js, the plugins, and the default theme. When I load the page however, its the default HTML5 video player and Videogular is not implemented.

My html code looks like:

<html ng-app="myapp">
    <head>
        <script src="angular.min.js"></script>
        <script src="jquery-2.0.3.min.js"></script>
        <script src="videogular/videogular.js"></script>
        <script src="videogular/plugins/controls.js" type="text/javascript"></script>
        <script src="videogular/plugins/overlay-play.js" type="text/javascript"></script>
        <script src="videogular/plugins/buffering.js" type="text/javascript"></script>
        <script src="videogular/plugins/poster.js" type="text/javascript"></script>
        <script src="videoserve.js"></script>
        <link rel="stylesheet" type="text/css" href="test.css">
    </head>
    <body ng-controller="MyController">
        <div id="videoDiv">
            <videogular vg-responsive="config.responsive" vg-autoPlay="config.autoPlay">
                <video class='videoPlayer' controls preload='metadata'>
                    <source src='assets/videos/Test 1080p HD.mp4' type='video/mp4'>
                </video>
                <vg-poster-image vg-url='config.plugins.poster.url' vg-stretch="config.stretch.value"></vg-poster-image>
                <vg-buffering></vg-buffering>
            </videogular>
        </div>
    </body>
</html>

And my js file looks like:

var app = angular.module('myapp', [
]);

app.controller('MyController', function($scope) {
    $scope.stretchModes = [
        {label: "None", value: "none"},
        {label: "Fit", value: "fit"},
        {label: "Fill", value: "fill"}
    ];

    $scope.config = {
        width: 740,
        height: 380,
        autoHide: false,
        autoPlay: true,
        responsive: false,
        stretch: $scope.stretchModes[0],
        transclude: true,
        theme: {
                url: "videogular/default/videogular.css",
                playIcon: "&#xe000;",
                pauseIcon: "&#xe001;",
                volumeLevel3Icon: "&#xe002;",
                volumeLevel2Icon: "&#xe003;",
                volumeLevel1Icon: "&#xe004;",
                volumeLevel0Icon: "&#xe005;",
                muteIcon: "&#xe006;",
                enterFullScreenIcon: "&#xe007;",
                exitFullScreenIcon: "&#xe008;"
            },
        plugins: {
            poster: {
                url: "assets/images/logo.png"
            }
        }
    };
});

I don't really see anything that I'm missing. I have the config object in the scope and a theme set (which apparently is mandatory). Does anyone see something that I can't?

EDIT: Never mind, turns out I forgot to include ngSantize and it's js file to my html header.

Share Improve this question edited Feb 11, 2014 at 18:20 GPinskiy asked Feb 9, 2014 at 19:32 GPinskiyGPinskiy 3071 gold badge6 silver badges21 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

You need to add Videogular modules to your module initialization.

var app = angular.module('myapp', [
            'ngSanitize',
            ".2fdevs.videogular",
            ".2fdevs.videogular.plugins.controls",
            ".2fdevs.videogular.plugins.overlayplay",
            ".2fdevs.videogular.plugins.buffering",
            ".2fdevs.videogular.plugins.poster"
        ]
    );

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745287083a4620627.html

相关推荐

  • javascript - Videogular Not Loading - Stack Overflow

    I'm trying to implement Videogular in my website, but without all the stuff that es with downloadi

    16小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信