I’m using the Builder plugin and have a block called “video” in a blueprint like this:
layout:
label: Main Content
type: builder
fieldsets:
video:
name: Video
fields:
v_type:
label: Select Video Type
type: radio
options:
internal: Self-hosted video
external: Video from YouTube or Vimeo
v_file:
label: Video file
type: files
max: 1
layout: cards
multiple: false
query: page.videos
when:
v_type: internal
v_url:
type: url
label: Video URL
when:
v_type: external
In my block template I have this code
$external = $data->v_url()->escape();
e($external->isNotEmpty(),video($external,[],[
'width'=>'560',
'height'=>'315',
'frameborder'=>"0",
'allow'=>"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"]
));
Why is it that whenever I use the e()
helper I’m getting the exception “Unexpected video type” if I’m adding video blocks with self-hosted videos instead of URLs but when I’m doing
$external = $data->v_url()->escape();
if($external->isNotEmpty()):
echo(video($external,[],[
'width'=>'560',
'height'=>'315',
'frameborder'=>"0",
'allow'=>"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"]
));
endif;
it works (i. e. no exception)?