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

How to add subtitle setting dynamically? #752

Closed
Tescan-group opened this issue May 11, 2024 · 1 comment
Closed

How to add subtitle setting dynamically? #752

Tescan-group opened this issue May 11, 2024 · 1 comment

Comments

@Tescan-group
Copy link

Hey there, could you help me out on how to add a subtitle menu like you have in the player at artplayer.org settings dynamically?

I want to add it in this JS code without having to create a new player if possible;

document.getElementById("ChangeServerButton").addEventListener("click", function() {
                art.switchUrl('<?php echo $videoUrl; ?>');
                art.quality = [];
                <?php if(isset($subtitles['English'])) : ?>
                    art.subtitle.url = '<?php echo $subtitles['English']; ?>';
                    art.subtitle.style({
                        color: '#fe9200',
                        fontSize: '25px',
                    });
                <?php endif; ?>
                
            	
            });

I basically want to add the subtitle option on the screenshot below without re-building the player;
image

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