shiyiya/oplayer

Keyboard shortcut feature is broken for the latest beta

evmatic opened this issue · 13 comments

The latest beta release has the keyboard shortcut feature broken.

Unhandled Promise Rejection: TypeError: this.player.context.ui.keyboard.register is not a function. (In 'this.player.context.ui.keyboard.register({l:()=>{this.$root.classList.toggle("active")}})', 'this.player.context.ui.keyboard...

ahh? order should be[ui(),playlist()]

player.use([ OPlayer.ui(), playlistPlugin ]);

It is exactly in the order as above, but the error still persist, and exist only in the beta 2 release only,

<script src="https://cdn.jsdelivr.net/npm/@oplayer/core@latest/dist/index.ui.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@oplayer/plugins@latest/dist/playlist.min.js"></script>
Please use these to initialise

manual add options for ui. @evmatic

keyboard:{focused: true}

You are right, adding this property keyboard:{focused: true} seems to finally solved the issue, but is this not been passed as default according to the documentation?

Also, when an item in a playlist is clicked, that particular item got disappeared with a grey rounded rectangular box taking up its place. this made looks like the player is broken, will be nice if this got fixed (screenshot attached)
Screenshot 2024-03-15 at 11 40 56 AM

Otherwise, its a awesome player...!

Seems a bit strange and probably not related to oplayer.
What's the 10:22?

Duration of the video, feels like it stems out from the updates to the Oplayer UI.
Some few days ago, It was working perfectly as fine, but after updates to the latest beta, it started to behave weirdly.

It will be nice to have the changes pushed separately only to their own version, but it seems to affect to all OPlayer irrespective of the versioning scheme, cause reverting back to the older version doesn't help much.

Is there an address online? Let me check.

separately

<script src="https://cdn.jsdelivr.net/npm/@oplayer/core@latest/dist/index.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@oplayer/ui@latest/dist/index.min.js"></script>

<script src="https://cdn.jsdelivr.net/npm/@oplayer/core@latest/dist/index.ui.js"></script> <script src="https://cdn.jsdelivr.net/npm/@oplayer/ui@latest/dist/index.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/@oplayer/plugins@latest/dist/playlist.min.js"></script>

`playlistPlugin=new OPlaylist({
initialIndex:index,
autoNext:true,
autoHide:true,
sources:src_arr
});

        player= OPlayer.make(video_id,{
            autoplay:true,
            autoFocus:true
        });

        player.use([
            OPlayer.ui(active_tab===obj.tab_video?{
                settings:[
                    {
                        key:"data-ph-subtitle",
                        type:"selector",
                        name:"Subtitle Help?"
                    },
                    'loop'
                ],
                slideToSeek:"always",
                forceLandscapeOnFullscreen:false,
                keyboard: { focused: true, global: false }
            }:null),
            playlistPlugin
        ]);

        player.create();`

This is exactly how we initialise...

yeah that's correct, I found out that the css style progress of the playlist item when it is clicked on is conflicting with the bootstrap progress classname, maybe you could append a namespace to your progress classname to avoid the collision? thanks

Thanks, fixed and working as expected with the version 1.0.10-beta.3,