Git Product home page Git Product logo

vjs-video's Introduction

vjs-video

An angular.js directive for video.js

Build Status npm version Bower version styled with prettier

With vjs-video, you can easily incorporate video and audio into your Angular projects using the robust HTML video player video.js.

The vjs-video directive handles all of the complexity involved with using video.js within an AngularJS Single Page App (SPA) and includes the following features:

  • bootstrapping video.js after the view is ready
  • properly disposing the video when the current Angular view is out of scope
  • loading and hot swaping videos using Angular data binding
  • audio support (for video.js versions >= 4.9)
  • responsive container (for video.js 4.x versions)

Dependencies

  • video.js (4.x or 5.x)
  • angular.js >= 1.3

Installation

The vjs-video directive avaible via both npm and bower.

Bower

The vjs-video directive is available via bower with built in dependencies for video.js and angular. Be sure to run npm install -g bower if you don't already have bower installed then run the following to install vjs-video into your project.

bower install --save vjs-video

If you leverage wiredep in your build workflow, all the required script and stylesheet includes are automatically injected into your html file.

Webpack

Use npm to install vjs-video. The angular and video.js modules will also be installed as dependencies if they aren't already defined.

npm install --save vjs-video

See here for an example of using vjs-video with webpack.

RequireJS

The AMD module loading pattern employed by require.js is supported by vjs-video but you must shim angular and define videojs as a path as seen in the following example.

scripts/main.js

//requirejs configuration
requirejs.config({
    baseUrl: 'bower_components',
    shim: {
        angular: {
            exports: 'angular'
        }
    },
    paths: {
        angular: 'angular/angular',
        videojs: 'video.js/dist/video-js/video',
        'vjs-video': '../scripts/directives/vjs.directive'
    }
});

//require angular and vjs-video
require(['angular', 'vjs-video'], function (angular) {
    angular.module('app', ['vjs.video'])
        .controller('MainCtrl', ['$scope', function (scope) {
            scope.$on('vjsVideoReady', function(e, data) {
                //data contains `id`, `vid`, `player` and `controlBar`
            });
        }]);
});

Manual Install

Download the latest vjs-video build as well as Angular and video.js. Then, include angular, video.js, and vjs-video as script tags along with it's corresponding css into your HTML page.

<html ng-app="app">
  <head>
    <link rel="stylesheet" href="bower_components/video.js/dist/video-js/video-js.css" />
  </head>
  <body ng-app="app">
    <script src="bower_components/angular/angular.js"></script>
    <script src="bower_components/video.js/dist/video.js"></script>
    <script src="bower_components/vjs-video/dist/vjs-video.js"></script>
</body>
</html>

Basic usage

The vjs-video directive is designed to be non-invasive; to use it, include vjs-video as a dependency and add the directive to a video or audio tag styled for video.js.

First include vjs-video as a dependency within your angular app:

angular.module('app', [ 'vjs.video']);

Next, add the vjs-video directive to a video or audio tag styled for video.js:

<video class="video-js vjs-default-skin" controls preload="auto"
       width="640" height="264" poster="poster.jpg" vjs-video>
    <source src="example_video.mp4" type="video/mp4">
</video>

Responsive Container

The vjs-video-container directive implements responsive sizing for the 4.x version of video.js 4.x. A custom aspect ratio can be defined with the default being the 16:9 wide screen ratio.

NOTE: The vjs-video-container is meant to be used with version 4.x of video.js; video.js 5.x natively supports video. If used with 5.0, the vjs-video-container aspect ratio values are passed through to video.js.

The following example wraps a video.js instance within a responsive container with a ratio of 4:3:

<vjs-video-container vjs-ratio="4:3">
    <video class="video-js vjs-default-skin" controls preload="auto" poster="poster.jpg">
        <source src="example_video.mp4" type="video/mp4">
    </video>
</vjs-video-container>

When using vjs-video-container be sure to attach all the directive attributes (such as vjs-setup or vjs-media) to the vjs-video-container element rather than on the enclosed video or audio tag. The attributes only should be attached when using in conjunction with the vjs-video directive on a video or audio tag.

Also, make sure you never mix usage of vjs-video-container with vjs-video. The vjs-video directive accepts the same directive attributes but shouldn't be used if a video or audio tag is wrapped inside of a vjs-video-container.

Directive Attributes

The vjs-video directive includes additional attributes that leverage AngularJS's strengths.

  • vjs-setup - accepts an object as alternative to using data-setup on the video element
  • vjs-media - accepts a bindable object that defines sources and tracks
  • vjs-ratio - defines the aspect ratio in the format width:height

NOTE: the vjs-ratio attribute support is limited to usage with the vjs-video-container item when using video.js < 5.0. In 5.0 and above, vjs-ratio can be used with the vjs-video directive as well.

vjs-setup

You can use vjs-setup instead of the data-setup attribute video.js uses if you would prefer to define all of the properties on the scope vs an inline JSON string.

The following example will set the loop option for the video.js instance using the vjs-setup attribute:

HTML

<video class="video-js vjs-default-skin" controls preload="auto"
       width="640" height="264" vjs-video vjs-setup="options">
    <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4' />
</video>

JavaScript

angular.module('app')
    .controller('MainCtrl', ['$scope', function (scope) {

        scope.options = {
            loop: true
        };
    }]);

vjs-media

The vjs-media option expects a reference to an object that contains a sources, tracks, and/or poster element. Whenever the vjs-media value is changed, video.js is reinitialized given the new data.

The following example defines a poster image, two sources and one track in a scope variable that is processed by vjs-video.

HTML

<video class="video-js vjs-default-skin" controls preload="auto"
       width="592" height="252" vjs-video vjs-media="mediaToggle">
</video>

JavaScript

angular.module('app')
    .controller('MainCtrl', ['$scope', function (scope) {
        scope.mediaToggle = {
            sources: [
                {
                    src: 'images/happyfit2.mp4',
                    type: 'video/mp4'
                },
                {
                    src: 'images/happyfit2.webm',
                    type: 'video/webm'
                }
            ],
            tracks: [
                {
                    kind: 'subtitles',
                    label: 'English subtitles',
                    src: 'assets/subtitles.vtt',
                    srclang: 'en',
                    default: true
                }
            ],
            poster: 'images/screen.jpg'
        };

        //listen for when the vjs-media object changes
        scope.$on('vjsVideoMediaChanged', function (e, data) {
            console.log('vjsVideoMediaChanged event was fired');
        });
    }]);

In the event that the vjs-media object changes, a vjsVideoMediaChanged event is fired within the scope context as seen in the above example.

vjs-ratio

The vjs-ratio attribute only works in conjunction with the vjs-video-container directive when using video.js 4.x but can be used with either the vjs-video or vjs-video-container directives when using version 5 of video.js. The value should list width and then height separated by a : (w:h). The value can be the actual width and height or the least common denominator such as 16:9.

Getting a reference to the video.js instance

There are times you will want to get access to the video object that video.js creates. The vjs-video directive dispatches an event after initialization and can be accessed by listening on the scope for the vjsVideoReady event.

angular.module('app')
    .controller('MainCtrl', ['$scope', function (scope) {
        scope.$on('vjsVideoReady', function (e, data) {
            //data contains `id`, `vid`, `player` and `controlBar`
            //NOTE: vid is depricated, use player instead
            console.log('video id:' + data.id);
            console.log('video.js player instance:' + data.player);
            console.log('video.js controlBar instance:' + data.controlBar);
        });
    }]);

The second parameter of the callback is a data object which contains the following:

  • id: the CSS id value for the video
  • player: the video.js player object instance
  • vid: the video.js player object instance (deprecated, use player instead)
  • controlBar: the controlBar element of the video.js object

Build & development

Run grunt for building and grunt serve for preview. All code modifications should be run through prettier by using an IDE pluggin or by running npm run prettier.

Testing

Running grunt test will run the unit tests with karma.

Release History

v0.1.11

  • formatted code with prettier (#77)
  • fixed issue where vjs-video did not work with video-js-contrib-ads; contribution by @MZeeshanSiddique (#75)
  • updated filepaths in README; contribution by @tiagomsmagalhaes

v0.1.10

  • fixes regression which broke webpack support (#64)

v0.1.9

  • fixed bug that broke RequireJS support (#61)
  • added documentation for using RequireJS with vjs-video

v0.1.8

  • fixed error where v0.1.7 failed to include proper minified files (#58)
  • added video.js and angular dependencies to the package.json (#59)
  • updated README regaurding dependencies on video.js and angular

v0.1.7

  • added support for CommonJS and AMD module loaders (#42)
  • updated documentation for legibility and clarity (#56)

v0.1.6

  • added support for using vjs-video with the audio tag; contribution by @cvn (#36)
  • updated documentation to fix typos and better explain how vjs-video works (#27)

v0.1.5

  • added player object to vjsVideoReady callback and deprecated the vid object

v0.1.4

  • added vjs-ratio support to vjs-video directive when using video.js >= 5.x (#19)

v0.1.3

  • fixed issue where vjs-ratio threw an angular error in certain cases (#15)
  • added reference to a video's controlBar in the vjsVideoReady callback (#17)

v0.1.2

  • added checks for mixed use of the vjs-video and vjs-video-container directives (#13)
  • updated documentation for clarity and fixed typos

v0.1.1

  • fixed issue where vjs-video didn't consistently work on mobile devices (#10)
  • updated GitHub pages site to be more mobile friendly

v0.1.0

  • initial release of vjs-video

vjs-video's People

Contributors

adrienbrunet avatar cvn avatar lonnygomes avatar mzeeshansiddique avatar tiagomsmagalhaes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vjs-video's Issues

Error thrown when using the VideoJS YouTube plugin

Just ran into a problem where I've added the VideoJS YouTube plugin and as soon as I specify youtube in the techOrder array I get the following error message

Error: directive must be attached to a video tag!
    at getVidElement (http://127.0.0.1:3001/assets/vendor/videojs/angular-vjs-video.js?body=1:44:27)
    at init (http://127.0.0.1:3001/assets/vendor/videojs/angular-vjs-video.js?body=1:278:36)
    at postLink (http://127.0.0.1:3001/assets/vendor/videojs/angular-vjs-video.js?body=1:320:17)
    at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:70:93
    at Z (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:70:149)
    at A (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:59:203)
    at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:51:299)
    at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:51:316)
    at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:50:415
    at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js:52:283 <div id="vjs_video_3" vjs-media="selectedMediaVideo" vjs-video="" data-setup="{ &quot;techOrder&quot;: [&quot;html5&quot;, &quot;flash&quot;, &quot;youtube&quot;] }" poster="" preload="auto" class="video-js vjs-default-skin vjs-paused vjs_video_3-dimensions vjs-controls-enabled vjs-user-inactive ng-isolate-scope">

It looks like the inclusion of the YouTube plugin converts the video element into an div element. I'll continue looking into it and report back if I find anything interesting.

How to change the players width or height?

I know this sounds very basic and silly question, I'm sorry for not being able to understand the readme correctly but can someone please help me understand how can I change the player's width/height from within the AngularJS controller?

crashes with angular 1.6.0 on chrome 55

*worked with angular 1.5.9
*tried with both video.js 5.12.6 and 5.14.1

edit
this seems to relate to a very weird chrome issue which started after updating angular and persisted until I uninstalled chrome, deleted appData/local/chrome, and re-installed.

closing this as it is not related to vjs-video. sorry

How to check the play status?

Hi, is there a way how check if the player is paused or not?
Something like this?
$scope.$watch('vjsVideoIsPlaying', function(oldVal, newVal) {
if (oldVal) {
console.log('old: ', oldVal);
}
});

vjsVideoMediaChanged doesn't fire

AngularJS 1.6
Video.js 5.14.1

I'm trying to reproduce the vjs-media="mediaToggle" example. The video plays successfully but I don't see the console message of the vjsVideoMediaChanged event.

Add vjs-ratio support to vjs-video directive

Currently, vjs-ratio is only supported with the vjs-video-container directive however since video.js 5.x supports a responsive container natively, the vis-ratio attribute could act as a convenient way to pass in the ratio when using 5.x.

Video crash when in fullscreen

Hi,
I've this code

angular
  .module('hrassistantApp', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngSanitize',
    'ngTouch',
    'ui.router',
    'gettext',
    'LocalStorageModule',
    'ui.bootstrap',
    'slickCarousel',
    'angular-jwt',
    'angularModalService',
    'ngRetina',
    'truncate',
    'ng.deviceDetector',
    'angular-fallback-image',
    'vjs.video'
  ]);

in html

<video class="video-js vjs-default-skin" controls preload="auto"
                width="640" height="264" poster="poster.jpg" vjs-video>
                <source src="https://videourl/Main_video.mp4" type="video/mp4">
            </video>

The video starts without problem, but when I try to go fullscreen by clicking the fullscreen control button, I've this error:


video.js:21347 VIDEOJS: ERROR: TypeError: Cannot read property 'vdata1481645318439' of null
    at Object.hasElData (http://0.0.0.0:9000/bower_components/video.js/dist/video.js:20077:14)
    at Object.trigger (http://0.0.0.0:9000/bower_components/video.js/dist/video.js:21034:22)
    at Player.trigger (http://0.0.0.0:9000/bower_components/video.js/dist/video.js:1771:12)
    at Player.documentFullscreenChange (http://0.0.0.0:9000/bower_components/video.js/dist/video.js:10191:17)
    at HTMLDocument.bound (http://0.0.0.0:9000/bower_components/video.js/dist/video.js:21135:15)
    at HTMLDocument.data.dispatcher (http://0.0.0.0:9000/bower_components/video.js/dist/video.js:20926:31)logByType @ video.js:21347
http://0.0.0.0:9000/poster.jpg Failed to load resource: the server responded with a status of 404 (Not Found)

schermata 2016-12-13 alle 17 14 54

I'm on localhost with grunt.

What can I do?

Thanks
\m

Add support for video.js 5.0

Video.js 5.0 was recently released. Currently, the directive is targeted to work for 4.x. Add support for 5.x as well.

  • videos do not properly remove during data binding
  • vjs-video-container throws error because a width and hight of auto is invalid in video.js 5.x
  • the vjs-video-container directive is obsolete in 5.0 and should alert the user

How to get player instance

Hi,
Your documentation indicates to use:

 scope.$on('vjsVideoReady', function (e, data) {
        //NOTE: vid is depricated, use player instead
        console.log('video.js player instance:' + data.player);
    });

but data.player comes back as undefined. Instead, if I use data.vid.player(), it works, but your note indicates that we should not use vid.
Using vjs-video 0.1.4 and video.js 5.5.3.
Thanks,

How to dispose audio of video

I try dispose the video when click SKIP button, the player has been destroyed, but the audio still play to end

		$scope.$on('vjsVideoReady', function(evt, videoData) {
			$document.on("click", ".intro-ctrl a.btn-skip", function() {
				videoData.player.dispose();
				$log.info('Disposed background video');
			});
		});

Can you help me?

Unable to add video dynamically

I'm developing an application using Ionic and in that I'm allowing user to upload videos. So for playing videos I have integrated Video.js library.

But when I try to add video like this

$scope.$on('vjsVideoReady', function(evt, videoData) {
                console.info('videoData :: ', videoData.vid.player().src);
                var source = { type: "video/mp4", src: $sce.trustAsResourceUrl("https://dg-users.s3.amazonaws.com/052188e99455195694ad0e14633b694c") };
                videoData.vid.player().src({ type: source.type, src: source.src });
            });

I get the MediaError : The media could not be loaded, either because the server or network failed or because the format is not supported.
The same video link I'm able to play by just using video.js lib.
I also tried the example given on this repo. But same result. Please tell me what I doing wrong?

hi~

videojs v4.12.15
When I use the rtmp protocol to play video, and then switch to other video when the error, but it seems to have no effect.
error info:
VIDEOJS: Video.js: currentTime unavailable on Flash playback technology element. TypeError: this.el_.vjs_getProperty is not a function
at subObj.api.(anonymous function) [as seeking] (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:7996:45)
at subObj.vjs.Flash.currentTime (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:7927:12)
at subObj.vjs.Player.techGet (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:4322:31)
at subObj.vjs.Player.currentTime (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:4407:42)
at subObj.vjs.CurrentTimeDisplay.updateContent (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:5602:92)
at subObj.ret (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:885:15)
at HTMLDivElement.ret (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:885:15)
at HTMLDivElement.data.dispatcher (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:360:29)
at Function.vjs.trigger (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:605:25)
at subObj.vjs.Component.trigger (http://localhost:63342/vjs/bower_components/video.js/dist/video-js/video.dev.js:2503:7)

Why I see controls when I disable them?

I see video statistics and controls despite I have them disabled. How to hide all these stuff?

View:

<div class="main-player-container">
    <video class="video-js vjs-default-skin" autoplay preload="auto"
               width="592" height="252" vjs-video vjs-media="mediaToggle">
    </video>
</div>

vjs-controls

Controller:

angular.module('VideoChannelCtrl', [])
    .controller('VideoChannelController', ['$scope', function($scope) {

    $scope.mediaToggle = {
        sources: [
            {   
                src: 'http://media.w3.org/2010/05/sintel/trailer.mp4',
                type: 'video/mp4'
            },
            {   
                src: 'http://media.w3.org/2010/05/bunny/trailer.mp4',
                type: 'video/mp4'
            }
        ]
    };

    //listen for when the vjs-media object changes
    $scope.$on('vjsVideoMediaChanged', function (e, data) {
        console.log('vjsVideoMediaChanged event was fired');
    });

}]);

vjs-video-container should error if used in combination with the vjs-video directive

A common mistake when using the vis-video-container directive is to also attempt to use vis-video on the internal video tag like the following:

<vjs-video-container>
    <video class="video-js vjs-default-skin" vjs-video vjs-ratio="640:264">
        <source src="http://video-js.zencoder.com/oceans-clip.mp4" type='video/mp4'/>
        <source src="http://video-js.zencoder.com/oceans-clip.webm" type='video/webm'/>
    </video>
</vjs-video-container>

This is incorrect and will lead to unpredictable behavior. To deter users from making this mistake, an error should be thrown to warn the user before going any further.

include issue

Hey there, thanks for your work. I am trying to switch from videogular to videojs for an ionic project. I'm trying to follow your instructions, which suggests I include a vjs.directive.js but the paths are not the same.

installation:

bower install vjs-video --save
find . -name *.directive.*
./www/lib/vjs-video/app/scripts/directives/vjs.directive.js
./www/lib/vjs-video/test/spec/directives/vjs.directive.js

Here is what I have included:

   <link rel="stylesheet" href="lib/video.js/dist/video-js/video-js.min.css">
 <script src="lib/video.js/dist/video-js/video.js"></script>
    <script src="lib/vjs-video/dist/vjs-video.js"></script>
    <script src="lib/vjs-video/app/scripts/directives/vjs.directive.js"></script>

The problem is if I add 'vis-video' to my module deps, I get an injector error.

video.js was not found!

i use the webpack for

require('../../node_modules/video.js/dist/video.min.js');
require('../../node_modules/video.js/dist/video-js.min.css');
require('../../node_modules/vjs-video/dist/vjs-video.min.js');

but has error
Error: video.js was not found!

i don't know wat't wrong~~

Remove external template for vjs-video-container

The angular template for vjs-video-container consists of two HTML elements and isn't worth the extra overhead of breaking out the markup in another file. The template should be inlined to remove the extra complexity.

How to add resolution toggle

Hi,
Thanks for providing this plugin, I wanted to add resolution toggle say SD, HD toggle with this directive I tried the following

$scope.mediaToggle = {
sources: [{
                src: /example/video,
                type: 'video/mp4',
                label: '360',
                res: '360'
              },
              {
                src:  /example/video,
                type: 'video/mp4',
                label: '480',
                res: '480'
              }
            ];
};

But am not getting the media toggle as expected, kindly help in resolving this. Thanks in advance.

On loop

Video player on loop downloads all the time same video over and over again :/

Does anyone can help me with it please?

$scope.options = {
loop: true,
autoplay: true
};

image

change video and end callback inside angular controller

Please advice how to implement this functionalities.
this is my start initialization - working fine
$scope.media_setup = { sources: [ { src: "https://d24uab5gycr2uz.cloudfront.net/stockmarketexperts-output/output/lecture-3-video-3-factors-of-fundamental-analysis-sd.m3u8", type: "application/x-mpegURL", } ] };

then

$scope.changeVideo = function(){ $scope.playInstance.media_setup = { sources: [ { src: "https://d24uab5gycr2uz.cloudfront.net/stockmarketexperts-output/output/lecture-3-video-3-factors-of-fundamental-analysis-sd.m3u8", type: "application/x-mpegURL", } ] }; };

$scope.$on('vjsVideoReady',function(e,data){ $scope.playInstance = data.player; });
this is not working

tried also
$scope.$on('$destroy',function(){
$scope.playInstance.dispose();
});

still no luck

display file

<video id="my_video_1"  class="video-js vjs-default-skin" controls preload="auto" width="640" height="268" vjs-media="media_setup" vjs-video vjs-setup='{ "playbackRates": [0.5, 1, 1.5, 2] }'>
        
    </video>

    <button ng-click="changeVideo()">Change</button>

Great resource but $destroy should be added to the docs

I had to read the source code to understand the API. I just think the docs could use a little bit of love. One example is the $destroy event. It is in the source but not in the docs.

That said this directive saved me a TON of time and thanks for making it.

How to use the "Player" API?

Hi, first of all, thanks for this directive :)

I've been a while playing around with this, but I definitely don't know how to do it. I need to access the methods of the Player API : http://docs.videojs.com/docs/api/player.html, so I can manually control the position of the video, get the video currentTime, etc.

My last try was something like this:

scope.$on('vjsVideoReady', function(evt, videoData) {
    scope.videoPlayer = window.videojs.Player(videoData.vid.tag);           
});

But I am getting the following error:

TypeError: this.getTagSettings is not a function
    at Function.vjs.Player.vjs.Component.extend.init (video.min.js:1)
    at Function.a [as Player] (video.min.js:1)
    at videoLibrary.js:3241
    at Scope.$emit (angular.js:12934)
    at null.<anonymous> (vjs.directive.js:236)
    at vjs.Component.ready (video.min.js:1)
    at vjs.Component.vjs.CoreObject.extend.init (video.min.js:1)
    at a [as constructor] (video.min.js:1)
    at vjs.Player.vjs.Component.extend.init (video.min.js:1)
    at new a (video.min.js:1)

The video.js version seems to be 4.2, according to window.videojs.CDN_VERSION (I entered to an ongoing project in my company, so the videojs library was already there, that's what I am looking at that CDN_VERSION property).

Any clues about how to achieve what I want?

Runtime Properties

This directive is great! It saved me so much time.

I need to log information about HLS playback quality. What is the best way for me to display the video.js runtime properties for example player.hls.segmentXhrTime, player.hls.bandwidth, player.hls.bytesReceived while the video is playing?

Huge thanks

How to load video without controls

Hi,

i wanted to load the video without the controls. I tried it by setting the options. But it didn't work this way.


$scope.playVideo = function(videoUrl) {
        $scope.mediaToggle = {
            sources: [
                {
                    src: videoUrl,
                    type: 'video/mp4'
                }
            ]
        };
        $scope.options = {
            loop: true,
            autoplay: true,
            controls: false
        };
    };

Angular 2 ?

Not familiar with Angular 1.x so I'm having a helluva time figuring our what applies anymore ;(
I need to start a new project using videojs and angular 2.
Shall I go bark up some other tree?

Add ability to pass in options to vjs-media

An use case was brought up in #28 where a user wanted to be able to pass in custom video.js options in the vjs-media object. There are several reasons someone may want to do something like this and it should be added as an additional feature.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.