Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hook up flashls level API as videojs custom SWF API. #3

Merged
merged 2 commits into from
Aug 22, 2014

Conversation

hohno-panopto
Copy link

This hooks up flashls API to custom video-js.swf layer.
This needs additional change inside video.js itself to let video-js users may access it finally.

This is diff for videojs/video.js repository.
I do not know what is the best way to delivery that part of the change, as videojs's project does not have our custom flash change (yet) and I assume they do not want to take this.

src/js/media/flash.js | 4 ++--
src/js/player.js | 21 +++++++++++++++++++++
2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/js/media/flash.js b/src/js/media/flash.js
index 1291146..1942a08 100644
--- a/src/js/media/flash.js
+++ b/src/js/media/flash.js
@@ -196,8 +196,8 @@ vjs.Flash.prototype.enterFullScreen = function(){
(function(){
// Create setters and getters for attributes
var api = vjs.Flash.prototype,

  • readWrite = 'rtmpConnection,rtmpStream,preload,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted'.split(','),
  • readOnly = 'error,networkState,readyState,seeking,initialTime,duration,startOffsetTime,paused,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks'.split(','),
  • readWrite = 'rtmpConnection,rtmpStream,preload,defaultPlaybackRate,playbackRate,autoplay,loop,mediaGroup,controller,controls,volume,muted,defaultMuted,level'.split(','),
  • readOnly = 'error,networkState,readyState,seeking,initialTime,duration,startOffsetTime,paused,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks,numberOfLevels,autoLevelEnabled'.split(','),
    // Overridden: buffered, currentTime, currentSrc
    i;

diff --git a/src/js/player.js b/src/js/player.js
index 781628b..960c74f 100644
--- a/src/js/player.js
+++ b/src/js/player.js
@@ -1649,6 +1649,27 @@ vjs.Player.prototype.playbackRate = function(rate) {

};

+vjs.Player.prototype.numberOfLevels = function () {

  • // getting
  • return parseInt(this.techGet('numberOfLevels'));
    +};

+vjs.Player.prototype.level = function (value) {

  • // setting
  • if (value !== undefined) {
  •    this.techCall('setLevel', value);
    
  •    return this;
    
  • }
  • // getting
  • return parseInt(this.techGet('level'));
    +};

+vjs.Player.prototype.autoLevelEnabled = function () {

  • // getting
  • return (this.techGet('autoLevelEnabled') === false) ? false : true;
    +};

// Methods to add support for
// networkState: function(){ return this.techCall('networkState'); },
// readyState: function(){ return this.techCall('readyState'); },

@hohno-panopto
Copy link
Author

I slightly updated in order to propagate level switch event to JS layer.
Associated video.js side of change is this:
https://www.dropbox.com/s/l6g4v4bwtm3xbdx/video.js.diff
(I pasted diff directly last time and that was totally broken.)

mangui added a commit that referenced this pull request Aug 22, 2014
Hook up flashls level API as videojs custom SWF API.
@mangui mangui merged commit 8c8aa02 into mangui:master Aug 22, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants