firecentaur / ngFlowPlayer

Angular FlowPlayer Directive
0 stars 1 forks source link

Problem while use flow player with wowza streaming engine in meanjs0.4.2 #2

Open ankkuboss opened 8 years ago

ankkuboss commented 8 years ago

I want to use flowPlayer directive to play RTMP streams from wowza streaming engine.

for this i have applied below code.

 'use strict';

    var app = angular.module('users');

   app.directive('flowPlayer', function ($compile) {
      var playerTemplate = '<a class="myplayer" style="display: block;width: 450px;height: 350px;margin: 25px 0;text-align: center;background-color: #000;"/></a>';
      return {
         restrict: 'E',
         template: playerTemplate,
        replace: true,
       scope: {

           player: '='
        },
    link: function (scope, element, attrs) {
    }
};
});
app.service('flowPlayerService', [function () {
return {
    player: null,
    construct: function (vidname, onReady) {

        console.log('constructing player %o', vidname);
        $f("a.myplayer", "/public/lib/flowplayer/flowplayer-3.2.18.swf", {
            // Configure Flowplayer to use the RTMP plugin for streaming.
            clip: {
                url: vidname,
                //  provider: 'swf'

            },
            //  engine:'html5',
            // Specify the location of the RTMP plugin.
            plugins: {
                //rtmp: {
                //    url:'js/flowplayer/flowplayer.rtmp-3.2.13.swf',
                //    netConnectionUrl:'rtmp://yourcloudfront.cloudfront.net/cfx/st'
                //}
            }
        });
        this.player = flowplayer();
    }
   };
     }]);

and getting below error

     33 |            $f("a.myplayer", "/public/lib/flowplayer/flowplayer-3.2.18.swf", {
                     ^ '$f' is not defined.
     49 |            this.player = flowplayer();
                                   ^ 'flowplayer' is not defined.

please help.

ankkuboss commented 8 years ago

to solve this I have added below line to .jshingrc file

   "globals": { 
        "angular": true,
        "io": true,
        "ApplicationConfiguration": true,
       "flowplayer": true,
       "$f":true
 },

the error in above post have solved but and flowplayer html rendered but getting black screen and mp3 file not played in Meanjs.