silvermine / videojs-chromecast

MIT License
147 stars 74 forks source link

feat: Add optional "Cast" label element #132

Closed izkmdz closed 1 year ago

izkmdz commented 1 year ago

Adds plugins.chromecast.addCastLabelToButton as an option in the plugin configuration options.

By default, the chromecast button component will display only an icon. Setting addCastLabelToButton to true will display a label titled "Cast" alongside the default icon.

    options = {
       fluid: true,
       techOrder: [ 'chromecast', 'html5' ],
       plugins: {
          chromecast: {
             addButtonToControlBar: true, // defaults to `true`
             addCastLabelToButton: true, // defaults to `false`
          }
       }
    };

If the configuration addButtonToControlBar is set to false, you will have to pass in the plugin options into the chromecast() method on ready.

    videojs('video_1', options, function() {
         var player = this;

         player.chromecast(options.plugins.chromecast);
    });

Style the chromecast button label by editing .vjs-chromecast-button-label.

coveralls commented 1 year ago

Coverage Status

Coverage remained the same at 0.0% when pulling 220c36247c9ac992b757b97257e24e665ac3feb5 on izkmdz:ismendoza/chromecast-button-options into 4557bef370c720c9b259ee7d0aad81416e0666f2 on silvermine:master.

izkmdz commented 1 year ago

Thank you for your suggestions and comments @yokuze ! I went ahead and applied your feedback. Feel free to review and let me know if there is anything else that needs to be adjusted. 👍