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

loadOptions() improvement #254

Closed
tomasdev opened this issue Jun 15, 2018 · 5 comments · Fixed by #258
Closed

loadOptions() improvement #254

tomasdev opened this issue Jun 15, 2018 · 5 comments · Fixed by #258

Comments

@tomasdev
Copy link
Contributor

tomasdev commented Jun 15, 2018

This is a suggestion, after reading #76

Currently, one needs to do the following for example, to change one of the options (in this case, switching camera facing mode from environment to user)

var player = videojs('videoTag', {
  plugins: {
    record: {
      video: {
        facingMode: 'environment'
      }
    }
  }
});
// ... then
player.options_.plugins.record.video.facingMode = 'user';
player.record().loadOptions();

It would be better to have loadOptions() accept an optional parameter being the object to get options merged with:

player.record().loadOptions({
  video: {
    facingMode: 'environment'
  }
});

(this would be 2 lines in a PR, I'm willing to do if this idea is accepted)

@thijstriemstra
Copy link
Member

thijstriemstra commented Jun 15, 2018

@tomasdev sounds good, cheers. And documenting this in the readme would be nice as well.

@thijstriemstra
Copy link
Member

@tomasdev any news?

tomasdev added a commit to tomasdev/videojs-record that referenced this issue Jul 16, 2018
Allows loadOptions() method to receive an options structure parameter.
thijstriemstra pushed a commit that referenced this issue Jul 16, 2018
Allows loadOptions() method to receive an options parameter
thijstriemstra added a commit that referenced this issue Jul 16, 2018
@naveedabbas2007
Copy link

Both of the above mentioned options are not switching the camera.

@naveedabbas2007
Copy link

Tried this
player.options_.plugins.record.video.facingMode = 'user';
player.record().loadOptions();
and this on as ell, I want to swith the camera but noting is working in my case
player.record().loadOptions({
video: {
facingMode: 'environment'
}
});

@thijstriemstra
Copy link
Member

@naveedabbas2007 don't hijack a ticket, please open a new one.

@collab-project collab-project locked as resolved and limited conversation to collaborators Nov 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants