| 1 | package LinkEmbedder::Link::Whereby; | ||
| 2 | use Mojo::Base 'LinkEmbedder::Link'; | ||
| 3 | |||
| 4 | has provider_name => 'Whereby'; | ||
| 5 | has provider_url => sub { Mojo::URL->new('https://whereby.com') }; | ||
| 6 | |||
| 7 | sub learn_p { | ||
| 8 | my $self = shift; | ||
| 9 | my $path = $self->url->path; | ||
| 10 | return $self->SUPER::learn_p unless @$path == 1; | ||
| 11 | |||
| 12 | $self->{iframe_src} = "https://whereby.com/$path->[0]?embed"; | ||
| 13 | $self->height(390) unless $self->height; | ||
| 14 | $self->width(740) unless $self->width; | ||
| 15 | $self->type('rich'); | ||
| 16 | $self->template([__PACKAGE__, 'appearin.html.ep']); | ||
| 17 | $self->title("Join the room $path->[0]"); | ||
| 18 | |||
| 19 | return Mojo::Promise->new->resolve($self); | ||
| 20 | } | ||
| 21 | |||
| 22 | 1; | ||
| 23 | |||
| 24 | __DATA__ |