mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-15 07:01:42 +00:00
poder editar videos
This commit is contained in:
parent
dbd64457e1
commit
1f28ea77a0
2 changed files with 13 additions and 2 deletions
|
@ -92,7 +92,6 @@ const blocks = {
|
|||
selector: "AUDIO",
|
||||
createFn: editorEl => {
|
||||
const el = document.createElement("AUDIO")
|
||||
el.controls = true
|
||||
return el
|
||||
},
|
||||
},
|
||||
|
@ -100,7 +99,13 @@ const blocks = {
|
|||
selector: "VIDEO",
|
||||
createFn: editorEl => {
|
||||
const el = document.createElement("VIDEO")
|
||||
el.controls = true
|
||||
el.poster = "/public/placeholder.png"
|
||||
// Para poder seleccionar el video tenemos que sacarle los
|
||||
// controles, pero queremos poder verlos para reproducir el video.
|
||||
// Al hacer click le damos los controles y al salir se los sacamos
|
||||
// para poder hacer click de vuelta
|
||||
el.addEventListener('click', event => event.target.controls = true)
|
||||
el.addEventListener('focusout', event => event.target.controls = false)
|
||||
return el
|
||||
},
|
||||
},
|
||||
|
@ -283,6 +288,7 @@ const typesWithProperties = {
|
|||
|
||||
const file = videoFileEl.files[0]
|
||||
|
||||
videoEl.poster = ""
|
||||
videoEl.src = URL.createObjectURL(file)
|
||||
videoEl.dataset.editorLoading = true
|
||||
uploadFile(file)
|
||||
|
|
|
@ -462,6 +462,11 @@ function setupEditor (editorEl) {
|
|||
document.addEventListener(editorBtn("video"), () => setAuxiliaryToolbar(editorEl, "video"))
|
||||
document.addEventListener(editorBtn("pdf"), () => setAuxiliaryToolbar(editorEl, "pdf"))
|
||||
|
||||
for (const video of document.querySelectorAll('.editor .editor-content video')) {
|
||||
video.addEventListener('click', event => event.target.controls = true)
|
||||
video.addEventListener('focusout', event => event.target.controls = false)
|
||||
}
|
||||
|
||||
cleanContent(contentEl)
|
||||
htmlEl.value = contentEl.innerHTML
|
||||
fixContent(contentEl)
|
||||
|
|
Loading…
Reference in a new issue