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

update strings using configure() #2131

Open
arunpt opened this issue Nov 1, 2023 · 1 comment
Open

update strings using configure() #2131

arunpt opened this issue Nov 1, 2023 · 1 comment
Labels

Comments

@arunpt
Copy link

arunpt commented Nov 1, 2023

Is it possible to update strings on the go using configure()?

I tried to update it via react useEffect, eventhough the resulting player object has the updated string, its not reflected in the player. I'm trying to add live view count to the live string without reloading the whole player

@arunpt arunpt added the question label Nov 1, 2023
@kslimani
Copy link
Contributor

kslimani commented Nov 1, 2023

Yes, you can override using player options, for example :

var playerElement = document.getElementById("player-wrapper");

var player = new Clappr.Player({
  source: 'http://clappr.io/highline.unknown', // will display "playback_not_supported" error message
  poster: 'http://clappr.io/poster.png',
  mute: true,
  height: 360,
  width: 640,
  strings: {
    'en': {
        'live': 'xxxx',
        'back_to_live': 'xxxx',
        'disabled': 'Xxxx',
        'playback_not_supported': 'Your browser Sux !.',
        'default_error_title': 'Xxx',
        'default_error_message': 'Xxxxx.',      
    },
    // 'lang': keyValueObject
  }
});

player.attachTo(playerElement);

You can try this code here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants