mzulkiakbari / videojs-resolution-switcher-for-videojs-version-7

22 stars 15 forks source link

Label set to TRUE but still see gear #5

Open SkuterPL opened 4 years ago

SkuterPL commented 4 years ago

I downloaded the newest version of videojs.js and your switcher, but I have problem with show my LABEL.

I wrote this code:

        videojs('video', {
          plugins: {
            videoJsResolutionSwitcher: {
              default: 'high',
              dynamicLabel: true
            }
          }
        });

But still see gear despite of my own labels.

mzulkiakbari commented 4 years ago

Can you take a screenshot? but i write with css.

SkuterPL commented 4 years ago

I tried to fix CSS by deleting :before (which adding gear) this code and add unset to height:

/*my custom*/
.vjs-control .vjs-button {
    height: unset;
}

.vjs-resolution-button .vjs-resolution-button-label {
  font-size: 1em;
  line-height: 3em;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  text-align: center;
  box-sizing: inherit;
}

.vjs-resolution-button .vjs-menu .vjs-menu-content {
  width: 4em;
  left: 50%; /* Center the menu, in it's parent */
  margin-left: -2em; /* half of width, to center */
}

.vjs-resolution-button .vjs-menu li {
  text-transform: none;
  font-size: 1em;
}

And after that gear disappear , but when I change resolution still I see 4K instead of my next choose:

image

But I think that it's JS problem, not CSS, like you see I use different template than default, but on default is problem too.

SkuterPL commented 4 years ago

Have you tried to fix it?

mzulkiakbari commented 4 years ago

You can to copy paste from my demo website : https://bariartz.github.io/videojs-by-pp/

mzulkiakbari commented 4 years ago

From my demo, i write script like :

`

var PkPlayer = videojs('pokoplayer',{

  "controls" : true,   "autoplay" : true,   "preload" : "metadata",   "width" : "100%",   "height" : "auto",   "poster" : "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg",   sources : [   { src : 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4', type : 'video/mp4', label : 'SHK', res: 'SHK'},   { src : 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4', type : 'video/mp4', label : 'HK', res: 'HK'},   { src : 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4', type : 'video/mp4', label : 'HD', res: 'HD'}   ],   });   videojs('pokoplayer').videoJsResolutionSwitcher();

` Try you write script like that. Good luck.

SkuterPL commented 4 years ago

I have the same, but no with JS, but in HTML with data artibutions but problem exits, look at my website: http://querko.linuxpl.eu/realizacje/wideo-prezentacje/pierwszy-film.html

if($('#video').length) { videojs('video', { controls: true, preload: 'auto', fluid: true, plugins: { videoJsResolutionSwitcher: { default: 'high', dynamicLabel: true } } }); }

This dynamicLabel: true doesn't work property. In your demo is gear icon, but I don't want this, I want my label name instead of gear icon.

mzulkiakbari commented 4 years ago

Oh you want like this http://m.pokonime.xyz/watch?v=7VFG_5dY6VMh ?

SkuterPL commented 4 years ago

No, here is gear in the background. I want only my label 4K, FHD or HD

mzulkiakbari commented 4 years ago

Oh i got it. Wait, i will to tried.

SkuterPL commented 4 years ago

Have you done it?

mzulkiakbari commented 4 years ago

Not yet. I think, this its already from the script JS from there. I just modify from this : https://github.com/kmoskwiak/videojs-resolution-switcher and script from there too. But, you must modify JS in script tag or from .js.

Pada tanggal Sen, 13 Jul 2020 pukul 23.30 SkuterPL notifications@github.com menulis:

Have you done it?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-657661680, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMNLQA757I72WJQEYYOHYQDR3MZD5ANCNFSM4OOCK34Q .

SkuterPL commented 4 years ago

What I should change? I use your version of videojs-resolution-switcher.js

mzulkiakbari commented 4 years ago

Try using this https://github.com/chrisboustead/videojs-hls-quality-selector#options in there you can find what you want.

mzulkiakbari commented 4 years ago

Or you can too using videojs resolution from original script in https://github.com/kmoskwiak/videojs-resolution-switcher . My version just fixing videojs resolution for videojs 7+.

SkuterPL commented 4 years ago

But this is another next plugin, I would like to do it only with your plugin, with order version of videojs it was enough for it

czw., 16 lip 2020, 15:46 użytkownik Muhammad Zulki Akbari < notifications@github.com> napisał:

Try using this https://github.com/chrisboustead/videojs-hls-quality-selector#options in there you can find what you want.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-659422946, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI26RAQBGUOZVJSW64M7XA3R34ACXANCNFSM4OOCK34Q .

SkuterPL commented 4 years ago

This origin version doesn't work with newest version of videojs 7, maybe do you have any communicator on which you could talk and find the best way to fix it

czw., 16 lip 2020, 15:51 użytkownik Muhammad Zulki Akbari < notifications@github.com> napisał:

Or you can too using videojs resolution from original script in https://github.com/kmoskwiak/videojs-resolution-switcher . My version just fixing videojs resolution for videojs 7+.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-659426348, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI26RATFXKZA4RDNQOLNO4TR34AXLANCNFSM4OOCK34Q .

mzulkiakbari commented 4 years ago

I already to modify script js, you can using this script by me https://github.com/bariartz/videojs-by-pp/blob/master/pk-resolution-switcher.js for example on https://bariartz.github.io/videojs-by-pp/

I recommended you following my step:

  1. Before tag close head you must insert <link href="videojs-resolution-switcher.css" rel="stylesheet">
  2. After video.js or video.min.js script tag you must insert <script src="pk-resolution-switcher.js"></script>, for pk-resolution-switcher.js script you can copy paste from https://github.com/bariartz/videojs-by-pp/blob/master/pk-resolution-switcher.js and you create file like that on your website.
  3. You can modify code if label inside pk-resolution-switcher.js on line 50. In there you can modify what you want label it depens from your video quality. I modify for 3 quality, you can add to be 4 with add else if.

if you still not understand, contact me.  

SkuterPL commented 4 years ago

It works, but I get some errors in console: video.min.js:12 VIDEOJS: ERROR: TypeError: Cannot read property 'one' of undefined at constructor.onClick (pk-resolution-switcher.js:79) at HTMLLIElement.o.dispatcher.o.dispatcher (video.min.js:12) (anonymous) @ video.min.js:12 n.error @ video.min.js:12 o.dispatcher.o.dispatcher @ video.min.js:12 and big button not showing up after pause it.

mzulkiakbari commented 4 years ago

in my opinion it doesn't matter because it doesn't change anything. Moreover, the error code only calls video with the type of Flash and has no impact on the source of the video. The code that I modified is actually compatible with videojs version 7 and below. In essence, it doesn't matter for a while until I really have perfected it with the latest version of VideoJS.

and for bigplaybutton I saw on your website is big button showing up when I tried to pause.

SkuterPL commented 4 years ago

but try to change resolution and after that you will not see big button again and after that I see errors in console, so I think that here is the problem not flash

SkuterPL commented 4 years ago

Have u checked this error and big button on pause?

mzulkiakbari commented 4 years ago

Error because it code not compatible with videojs version 7+, i will tried to moving to videojs 7+. If you can modify js script, you can try.

SkuterPL commented 4 years ago

Let me know what I should modify or send me modified file

mzulkiakbari commented 4 years ago

On line 63. You can modified in there. Normally, in code this.player_.paused();. tried to change it. while you are modif I also try to perfect this code.

SkuterPL commented 4 years ago

But what I need to change there? Can u send me correct file?

mzulkiakbari commented 4 years ago

I am stuck. After all, maybe from videojs hidden bigPlayButton. So i can't to fixing. This is code too from original script. I just modified so that show in videojs 7+. From original script too, you can't hidden gear. if you want setting like you need, you can using sleev.js in https://github.com/maluklo/Sleev-player and you can hidden gear with css.

SkuterPL commented 4 years ago

But before you modify it works normally (even with your js which is on your gitlab), so something is wrong with your modified code.

I won't use old version of videoJS

czw., 23 lip 2020, 14:36 użytkownik Muhammad Zulki Akbari < notifications@github.com> napisał:

I am stuck. After all, maybe from videojs hidden bigPlayButton. So i can't to fixing. This is code too from original script. I just modified so that show in videojs 7+. From original script too, you can't hidden gear. if you want setting like you need, you can using sleev.js in https://github.com/maluklo/Sleev-player and you can hidden gear with css.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-662981736, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI26RAT7QJ67Y5FEUINJLGTR5AVGHANCNFSM4OOCK34Q .

mzulkiakbari commented 4 years ago

Try modified pk-resolution-switcher.js, then find this code if (!isPaused) { this.player_.bigPlayButton.hide(); } if there is delete it. Normally on line 69.

SkuterPL commented 4 years ago

I found it and delete it, and now big button show up :) so it works, but in console still I see error, there is any chance to remove this?

Sorry for long time, but I didn't have time earlier, but now I have to come back to this issue.

SkuterPL commented 3 years ago

Any idea how to fix it?

mzulkiakbari commented 3 years ago

ya, maybe have idea now, but wait a few days or week, maybe.

Pada tanggal Rab, 23 Des 2020 pukul 02.51 SkuterPL notifications@github.com menulis:

Any idea how to fix it?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-749744920, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMNLQA7XLEVQQUVXILB2WQTSWD2FPANCNFSM4OOCK34Q .

SkuterPL commented 3 years ago

Okey, I will, but pls remember about me

śr., 23 gru 2020, 08:22 użytkownik Muhammad Zulki Akbari < notifications@github.com> napisał:

ya, maybe have idea now, but wait a few days or week, maybe.

Pada tanggal Rab, 23 Des 2020 pukul 02.51 SkuterPL < notifications@github.com> menulis:

Any idea how to fix it?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub < https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-749744920 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AMNLQA7XLEVQQUVXILB2WQTSWD2FPANCNFSM4OOCK34Q

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-749983306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI26RAROGZ4CZBZBIJ3V3WLSWGLBRANCNFSM4OOCK34Q .

mzulkiakbari commented 3 years ago

Okay, nice to meet you

Pada tanggal Rab, 23 Des 2020 pukul 15.25 SkuterPL notifications@github.com menulis:

Okey, I will, but pls remember about me

śr., 23 gru 2020, 08:22 użytkownik Muhammad Zulki Akbari < notifications@github.com> napisał:

ya, maybe have idea now, but wait a few days or week, maybe.

Pada tanggal Rab, 23 Des 2020 pukul 02.51 SkuterPL < notifications@github.com> menulis:

Any idea how to fix it?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub <

https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-749744920

, or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AMNLQA7XLEVQQUVXILB2WQTSWD2FPANCNFSM4OOCK34Q

.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub < https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-749983306 , or unsubscribe < https://github.com/notifications/unsubscribe-auth/AI26RAROGZ4CZBZBIJ3V3WLSWGLBRANCNFSM4OOCK34Q

.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/bariartz/videojs-resolution-switcher-for-videojs-version-7/issues/5#issuecomment-750005068, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMNLQA3PXIUNPD3B35OR66TSWGSPZANCNFSM4OOCK34Q .

mzulkiakbari commented 3 years ago

Maybe you install theme right? try to using default theme from videoJS. Possibility why not showing big button while pause cause theme. In my website demo, i using default theme : https://bariartz.github.io/videojs-by-pp/

utsavsomaiya commented 1 year ago

Hey, How can I import it in Vue js?

Because it is not working in my pc