Sha256: 3192f600db0fdf9a946f2f15010329b5a1d13925dc92423766d2da9e49c53025
Contents?: true
Size: 851 Bytes
Versions: 2
Compression:
Stored size: 851 Bytes
Contents
# frozen_string_literal: true module Onebox module Mixins module TwitchOnebox def self.included(klass) klass.include(Onebox::Engine) klass.matches_regexp(klass.twitch_regexp) klass.include(InstanceMethods) end module InstanceMethods def twitch_id @url.match(self.class.twitch_regexp)[1] end def base_url "player.twitch.tv/?" end def placeholder_html "<div class='onebox-placeholder-container'><span class='placeholder-icon video'></span></div>" end def to_html "<iframe src=\"//#{base_url}#{query_params}&autoplay=false\" width=\"620\" height=\"378\" frameborder=\"0\" style=\"overflow: hidden;\" scrolling=\"no\" allowfullscreen=\"allowfullscreen\"></iframe>" end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
onebox-1.9.1 | lib/onebox/mixins/twitch_onebox.rb |
onebox-1.9.0 | lib/onebox/mixins/twitch_onebox.rb |