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 we can append subtitles after the player is playing ? #64

Open
arenabg opened this issue Jul 3, 2016 · 0 comments
Open

How we can append subtitles after the player is playing ? #64

arenabg opened this issue Jul 3, 2016 · 0 comments

Comments

@arenabg
Copy link

arenabg commented Jul 3, 2016

Hello there.

I want to append subtitles after the player has been in playing state.

I try like this:

`
if (!subs) {

console.log('no subtitles found');

} else {

                if (player.itemCount() > 0 && !player.itemDesc(player.currentItem()).setting.checkedSubs) {

                    newSettings = player.vlc.playlist.items[player.currentItem()].setting;

                    if (isJsonString(newSettings)) {

                        newSettings = JSON.parse(newSettings);

                        if (newSettings.subtitles) jQuery.extend(newSettings.subtitles, subs); else newSettings.subtitles = subs;

                    } else {

                        newSettings = {};

                        newSettings.subtitles = subs;

                    }

                    newSettings.checkedSubs = true;

                    player.vlc.playlist.items[player.currentItem()].setting = JSON.stringify(newSettings);

                    setTimeout(function() {

                        player.refreshSubtitles();

                        player.wrapper.find(".wcp-subtitle-but").show(0);

                        player.wrapper.find(".wcp-show-subtitles").css('display', 'inline-block');

                    }, 100);

                }
            }

`

which i have found in PowderPlayer, but it doesnt work.

Somehow .setting of the currentItem is not refreshed.

Thanks

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

No branches or pull requests

1 participant