fix(web): for sensitive video dont preload source
This commit is contained in:
parent
e96b778392
commit
a60b5774a1
1 changed files with 6 additions and 4 deletions
|
@ -40,18 +40,20 @@ pub fn Attachment(
|
||||||
</p>
|
</p>
|
||||||
}.into_view(),
|
}.into_view(),
|
||||||
|
|
||||||
"video" =>
|
"video" => {
|
||||||
|
let _href = href.clone();
|
||||||
view! {
|
view! {
|
||||||
<div class="center cursor box ml-1"
|
<div class="center cursor box ml-1"
|
||||||
on:click=move |_| set_expand.set(!expand.get())
|
on:click=move |_| set_expand.set(!expand.get())
|
||||||
title={object.name().unwrap_or_default().to_string()}
|
title={object.name().unwrap_or_default().to_string()}
|
||||||
>
|
>
|
||||||
<video controls loop class="attachment" class:expand=expand >
|
<video controls loop class="attachment" class:expand=expand >
|
||||||
<source src={href.clone()} type={media_type} />
|
{move || if sensitive && !expand.get() { None } else { Some(view! { <source src={_href.clone()} type={media_type.clone()} /> }) }}
|
||||||
<a href={href} target="_blank">audio clip</a>
|
<a href={href.clone()} target="_blank">video clip</a>
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
}.into_view(),
|
}.into_view()
|
||||||
|
},
|
||||||
|
|
||||||
"audio" =>
|
"audio" =>
|
||||||
view! {
|
view! {
|
||||||
|
|
Loading…
Reference in a new issue