discourse/lib/onebox/engine/twitch_clips_onebox.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
405 B
Ruby
Raw Normal View History

# frozen_string_literal: true
require_relative "../mixins/twitch_onebox"
class Onebox::Engine::TwitchClipsOnebox
def self.twitch_regexp
%r{^https?://clips\.twitch\.tv/([a-zA-Z0-9_]+/?[^#\?/]+)}
end
include Onebox::Mixins::TwitchOnebox
requires_iframe_origins "https://clips.twitch.tv"
def query_params
"clip=#{twitch_id}"
end
def base_url
"clips.twitch.tv/embed?"
end
end