Skip to content

Commit

Permalink
Added setplaybackrate method in each adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
mudit2108 committed Mar 11, 2024
1 parent 16b528e commit f0f4e67
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Player.js",
"name": "@gumlet/player.js",
"version": "1.0.3",
"version": "1.0.4",
"homepage": "http://github.com/gumlet/player.js",
"main": "dist/player.min.js",
"repository": {
Expand Down
4 changes: 4 additions & 0 deletions src/adapters/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ playerjs.HTML5Adapter.prototype.init = function(video){
receiver.on('setLoop', function(value){
video.loop = value;
});

receiver.on('setPlaybackRate', function(value){
video.playbackRate = value;
});
};

/* Call when the video has loaded */
Expand Down
4 changes: 4 additions & 0 deletions src/adapters/mock.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ playerjs.MockAdapter.prototype.init = function(){
receiver.on('setLoop', function(value){
video.loop = value;
});

receiver.on('setPlaybackRate', function(value){
video.speed = value;
});
};

/* Call when the video has loaded */
Expand Down
4 changes: 4 additions & 0 deletions src/adapters/video.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ playerjs.VideoJSAdapter.prototype.init = function(player){
receiver.on('setLoop', function(value){
player.loop(value);
});

receiver.on('setPlaybackRate', function(value){
player.playbackRate(value);
});
};

/* Call when the video.js is ready */
Expand Down

0 comments on commit f0f4e67

Please sign in to comment.