Añadir vídeo a la traducción

Avatar de Usuario
Mar
Mensajes: 65
Registrado: 18 Ene 2018, 00:32
x 21

Re: Añadir vídeo a la traducción

Mensaje por Mar » 14 Nov 2018, 22:43

Hola!!

Pregunta: ¿le ha dado problemas a alguien más esto del vídeo? ¿Es cosa mía y de mis torpezas?

Es que los dos últimos vídeos que he intentado meter en la ventanita esta, ni cargaban ni reproducían, vaya, que aquello no daba signo alguno de actividad.
En el capítulo anterior en el que estuve traduciendo, supuse que era una cuestión del tamaño del vídeo, que era bastante grande, así que lo dejé estar y pasé de todo...
Pero en este último, lo tuve en cuenta y lo intenté con un vídeo de 170Mb aprox. Me ha dado lo mismo. Lo he intentado hoy mismo otra vez, pero nada.

¿Os ha pasado alguna vez??
Gracias! :)
✽❀⚘✿ Cada mayo trae sus flores ✽❀⚘✿❃✽❀⚘✿✽❀⚘✿ :)

Avatar de Usuario
el_lobo
Mensajes: 26
Registrado: 13 Jul 2018, 23:10
x 7

Re: Añadir vídeo a la traducción

Mensaje por el_lobo » 14 Nov 2018, 23:17

Mar escribió: Pregunta: ¿le ha dado problemas a alguien más esto del vídeo? ¿Es cosa mía y de mis torpezas?
Yo no uso el script porque no funciona en mi Firefox :roll:

Pero para probar, abrí Chromium, y sí me carga los MKV, pero no los AVI.
1 x

Avatar de Usuario
Mar
Mensajes: 65
Registrado: 18 Ene 2018, 00:32
x 21

Re: Añadir vídeo a la traducción

Mensaje por Mar » 14 Nov 2018, 23:23

Hola, el_lobo, gracias!!

Yo también uso Firefox, igual ahí está la cosa, aunque hace unas semanas sí me funcionaba.

Gracias por la info, pero hablas con una torpe total en cuanto a la tecnología, y eso de Chromium... no sé muy bien ni qué es ni cómo se usa. Lo investigaré de todas formas!!
Y probaré en Chrome, el explorador, que eso sí lo veo fácil y factible para mí!

Muchas gracias! :)
✽❀⚘✿ Cada mayo trae sus flores ✽❀⚘✿❃✽❀⚘✿✽❀⚘✿ :)

Avatar de Usuario
marilynbrown2
Moderador
Mensajes: 3186
Registrado: 29 Jun 2017, 18:19
x 1014

Re: Añadir vídeo a la traducción

Mensaje por marilynbrown2 » 14 Nov 2018, 23:27

Mar escribió:
14 Nov 2018, 23:23
Hola, el_lobo, gracias!!

Yo también uso Firefox, igual ahí está la cosa, aunque hace unas semanas sí me funcionaba.

Gracias por la info, pero hablas con una torpe total en cuanto a la tecnología, y eso de Chromium... no sé muy bien ni qué es ni cómo se usa. Lo investigaré de todas formas!!
Y probaré en Chrome, el explorador, que eso sí lo veo fácil y factible para mí!

Muchas gracias! :)
Con Chrome, en principio, no hay mucho problema, pero usa mejor archivos pequeños ;)
1 x
Subtitle Together, Die Alone.

Avatar de Usuario
carochristie
Moderador
Mensajes: 1432
Registrado: 30 Jun 2017, 04:17
x 1331

Re: Añadir vídeo a la traducción

Mensaje por carochristie » 14 Nov 2018, 23:31

el_lobo escribió:
14 Nov 2018, 23:17

Yo no uso el script porque no funciona en mi Firefox :roll:

Pero para probar, abrí Chromium, y sí me carga los MKV, pero no los AVI.
Está aclarado en el primer mensaje de este hilo.
Lo he probado en Firefox (mp4) y Chrome (mp4 y mkv) usando Violentmonkey y va genial. Lo dejo aquí por si alguien lo quiere utilizar o editar a su gusto.
Si es mkv, no va a funcionar en ningún Firefox, ni siquiera el tuyo. ;) Gracias por comentar lo de Chromium, alguien quizá lo use.
1 x
Concéntrate en la música e ignora el ruido

Avatar de Usuario
Mar
Mensajes: 65
Registrado: 18 Ene 2018, 00:32
x 21

Re: Añadir vídeo a la traducción

Mensaje por Mar » 14 Nov 2018, 23:36

Vale, pues muchas gracias a los tres!

Ya lo he entendido!
He estado revisando los archivos que utilicé. La semana pasada era mp4, así que quizá el problema fue el tamaño...
El de esta semana, efenctivaente, era un mkv, ni m había fijado en eso, me había fijado solo en que fuese de menor tamaño y mira, metí la pata por otro lado...

¡Misterio resuelto!

Graciassss!! :)
✽❀⚘✿ Cada mayo trae sus flores ✽❀⚘✿❃✽❀⚘✿✽❀⚘✿ :)

Avatar de Usuario
vickys
Mensajes: 18
Registrado: 26 Oct 2018, 21:51
x 9
Contactar:

Re: Añadir vídeo a la traducción

Mensaje por vickys » 16 Nov 2018, 21:36

Madre mia esto es genial!!!!!!!! :shock: :shock: :shock:
Lo acabo de probar con chrome y funciona estupendamente......no te imaginas lo bien que a mi me viene, sobretodo cuando faltan los guiones de los dalogos!!
MIL GRACIAS
2 x
Quien quiere hacer algo, encuentra un medio. Quien no quiere hacer nada, encuentra un motivo.

Avatar de Usuario
athk
Developer
Mensajes: 948
Registrado: 29 Jun 2017, 15:35
x 961

Re: Añadir vídeo a la traducción

Mensaje por athk » 15 Ene 2021, 18:49

Lo he roto :oops:
2 x

Avatar de Usuario
ciudadela
Mensajes: 318
Registrado: 03 Jul 2017, 17:45
x 182

Re: Añadir vídeo a la traducción

Mensaje por ciudadela » 15 Ene 2021, 19:12

athk escribió:
15 Ene 2021, 18:49
Lo he roto :oops:
:( :( :( :( :( :( :( :( :( :( :( :( :( :(

¿No habrá manera de adaptarlo?

Avatar de Usuario
petycris
Mensajes: 559
Registrado: 03 Jul 2017, 00:47
x 249

Re: Añadir vídeo a la traducción

Mensaje por petycris » 15 Ene 2021, 19:13

athk escribió:
15 Ene 2021, 18:49
Lo he roto :oops:
El que rompe arregla :P

Avatar de Usuario
athk
Developer
Mensajes: 948
Registrado: 29 Jun 2017, 15:35
x 961

Re: Añadir vídeo a la traducción

Mensaje por athk » 16 Ene 2021, 00:40

No es elegante, pero mejor que roto...

Código: Seleccionar todo

// ==UserScript==
// @name Subtitulamos Video Hook
// @namespace subtitulamos
// @match https://www.subtitulamos.tv/subtitles/*/translate
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// ==/UserScript==

// SRT to WebVTT by Silvia Pfeiffer - https://silviapfeiffer.github.io
function srt2vtt(b){b=b.replace(/\r+/g,'');b=b.replace(/^\s+|\s+$/g,'');b=b.split('\n\n');var f='';if(0<b.length){f+='WEBVTT\n\n';for(var g=0;g<b.length;g+=1){var e='';for(var a=b[g].split(/\n/);3<a.length;){for(var c=3;c<a.length;c++)a[2]+='\n'+a[c];a.splice(3,a.length-3)}c=0;!a[0].match(/\d+:\d+:\d+/)&&a[1].match(/\d+:\d+:\d+/)&&(e+=a[0].match(/\w+/)+'\n',c+=1);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);d?(e+=d[1]+':'+d[2]+':'+d[3]+'.'+d[4]+' --\x3e '+d[5]+':'+d[6]+':'+d[7]+'.'+d[8]+'\n',c+=1,a[c]&&(e+=a[c]+'\n\n')):e=''}else e='';f+=e}}return f}

const run = function() {
  // create and append vbox
  var vbox = document.createElement('div')
  vbox.id = 'vbox'
  vbox.style.display = 'none'
  vbox.innerHTML = '<video controls><track default></video>'
  var vid = vbox.children[0]
  var sub = vid.children[0]
  var vbTo = document.createElement('i')
  vbTo.id = 'vbTo'
  vbTo.className = 'fa fa-chevron-down'
  document.getElementById('translation-tools').appendChild(vbox).parentElement.appendChild(vbTo)

  console.log(document.getElementById('episode-header').children[0].href);
  // get subtitle id
  GM_xmlhttpRequest({
    method: 'GET',
    url: document.getElementById('episode-header').children[0].href,
    onload: function(req) {
      var subId = /href="\/subtitles\/(\d+)\/translate"/.exec(req.responseText)[1]
      // load subtitle
      GM_xmlhttpRequest({
        method: 'GET',
        url: 'https://www.subtitulamos.tv/subtitles/'+subId+'/download',
        onload: function(req) {
          var subData = srt2vtt(req.responseText)
          var subUrl = URL.createObjectURL(new Blob([subData], {type : 'text/vtt'}))
          sub.src = subUrl
        }
      })// load subtitle
    }
  })

  // load video
  function loadVideo(vidFile) { vid.src = URL.createObjectURL(vidFile) }
  // open video
  function playPause() { (vid.paused) ? vid.play() : vid.pause() }
  vbox.onclick = function(ev) {
    if (ev.target == this) {
      var input = document.createElement('input')
      input.type = 'file'
      input.onchange = function(ev) { loadVideo(ev.target.files[0]) }
      input.click()
    } else playPause()
  }
  // drop video
  vbox.ondragover = function(ev) { ev.preventDefault() }
  vbox.ondrop = function(ev) {
    ev.preventDefault()
    loadVideo(ev.dataTransfer.items[0].getAsFile())
  }
  // video onload
  vid.oncanplay = function() { vid.style.zIndex = 1 }
  vid.onerror = function() { vid.style.zIndex = -1 }

  // show/hide vbox
  function showVbox() {
    vbox.style.display = 'inline-block'
    vbTo.className = 'fa fa-chevron-up'
  }
  function hideVbox() {
    vbox.style.display = 'none'
    vbTo.className = 'fa fa-chevron-down'
    vid.pause()
  }
  vbTo.onclick = function(ev) {
    ev.stopPropagation()
    if (vbox.style.display == 'none') showVbox()
    else hideVbox()
  }

  // seek video
  document.getElementById('sequences').addEventListener('click', function(ev) {
    var hsm = '', path = []
    if (ev.path) path = ev.path // chrome fix removed el
    else { // rest
      var el = ev.target
      while (el != this) { path.push(el); el = el.parentElement }
    }
    for (var i=0,ii=path.length; i<ii; i++) {
      if (path[i].classList.contains('time')) {
        if (path[i].tagName == 'PRE') hsm = path[i].innerText // chrome fix removed el
        else hsm = path[i].children[0].innerText || path[i].children[0].value
        break
      } else if (path[i] == this) break
    }
    // calc sec and seek
    if (hsm) {
      var hmsList = hsm.split('.')[0].split(':'), s = 0, v = 1
      while (hmsList.length) {
        s += hmsList.pop() * v
        v *= 60
      }
      vid.currentTime = s
      vid.play()
      showVbox()
    }
  })

  // keyboard
  document.addEventListener('keyup', function(ev) {
    if (ev.ctrlKey) {
      switch (ev.code) {
        case 'Space': playPause(); break
        case 'Comma': vid.style.width = vid.offsetWidth + 50 + 'px'; break
        case 'Period': vid.style.width = vid.offsetWidth - 50 + 'px'; break
      }
    }
  })

  GM_addStyle(`
    #vbox {
      float: right;
      position: relative;
      top: -15px;
      font-size: 0;
      background-color: inherit;
    }
    #vbox::before {
      content: 'Abre o arrastra vídeo';
      display: flex;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      margin: 5%;
      border: 3px #777 dashed;
      border-radius: 20px;
      font-family: 'Open Sans', arial, sans-serif;
      font-size: 16px;
      font-weight: bold;
      color: #777;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    #vbox > video {
      position: relative;
      width: 25vw;
      max-width: 50vw;
      min-width: 300px;
      z-index: -1;
    }
    #vbox > video::cue {
      position: relative;
      bottom: 20px;
      font-family: 'Open Sans', arial, sans-serif;
      font-size: 16px;
      text-shadow: 2px 2px 2px black;
      color: white;
      background: none;
    }
    #vbTo {
      visibility: visible;
      position: absolute;
      top: 0;
      right: -15px;
      padding: 4px 8px 16px 12px;
      font-size: 18px;
      color: var(--color-blue-a);
      opacity: .5;
      cursor: pointer;
      z-index: 2;
    }
    .time > div {
      cursor: pointer;
    }
  `)
};

unsafeWindow.addEventListener("load", run);
6 x

Avatar de Usuario
petycris
Mensajes: 559
Registrado: 03 Jul 2017, 00:47
x 249

Re: Añadir vídeo a la traducción

Mensaje por petycris » 16 Ene 2021, 09:49

Gracias!!!!!!
athk escribió:
16 Ene 2021, 00:40
No es elegante, pero mejor que roto...

Código: Seleccionar todo

// ==UserScript==
// @name Subtitulamos Video Hook
// @namespace subtitulamos
// @match https://www.subtitulamos.tv/subtitles/*/translate
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// ==/UserScript==

// SRT to WebVTT by Silvia Pfeiffer - https://silviapfeiffer.github.io
function srt2vtt(b){b=b.replace(/\r+/g,'');b=b.replace(/^\s+|\s+$/g,'');b=b.split('\n\n');var f='';if(0<b.length){f+='WEBVTT\n\n';for(var g=0;g<b.length;g+=1){var e='';for(var a=b[g].split(/\n/);3<a.length;){for(var c=3;c<a.length;c++)a[2]+='\n'+a[c];a.splice(3,a.length-3)}c=0;!a[0].match(/\d+:\d+:\d+/)&&a[1].match(/\d+:\d+:\d+/)&&(e+=a[0].match(/\w+/)+'\n',c+=1);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);d?(e+=d[1]+':'+d[2]+':'+d[3]+'.'+d[4]+' --\x3e '+d[5]+':'+d[6]+':'+d[7]+'.'+d[8]+'\n',c+=1,a[c]&&(e+=a[c]+'\n\n')):e=''}else e='';f+=e}}return f}

const run = function() {
  // create and append vbox
  var vbox = document.createElement('div')
  vbox.id = 'vbox'
  vbox.style.display = 'none'
  vbox.innerHTML = '<video controls><track default></video>'
  var vid = vbox.children[0]
  var sub = vid.children[0]
  var vbTo = document.createElement('i')
  vbTo.id = 'vbTo'
  vbTo.className = 'fa fa-chevron-down'
  document.getElementById('translation-tools').appendChild(vbox).parentElement.appendChild(vbTo)

  console.log(document.getElementById('episode-header').children[0].href);
  // get subtitle id
  GM_xmlhttpRequest({
    method: 'GET',
    url: document.getElementById('episode-header').children[0].href,
    onload: function(req) {
      var subId = /href="\/subtitles\/(\d+)\/translate"/.exec(req.responseText)[1]
      // load subtitle
      GM_xmlhttpRequest({
        method: 'GET',
        url: 'https://www.subtitulamos.tv/subtitles/'+subId+'/download',
        onload: function(req) {
          var subData = srt2vtt(req.responseText)
          var subUrl = URL.createObjectURL(new Blob([subData], {type : 'text/vtt'}))
          sub.src = subUrl
        }
      })// load subtitle
    }
  })

  // load video
  function loadVideo(vidFile) { vid.src = URL.createObjectURL(vidFile) }
  // open video
  function playPause() { (vid.paused) ? vid.play() : vid.pause() }
  vbox.onclick = function(ev) {
    if (ev.target == this) {
      var input = document.createElement('input')
      input.type = 'file'
      input.onchange = function(ev) { loadVideo(ev.target.files[0]) }
      input.click()
    } else playPause()
  }
  // drop video
  vbox.ondragover = function(ev) { ev.preventDefault() }
  vbox.ondrop = function(ev) {
    ev.preventDefault()
    loadVideo(ev.dataTransfer.items[0].getAsFile())
  }
  // video onload
  vid.oncanplay = function() { vid.style.zIndex = 1 }
  vid.onerror = function() { vid.style.zIndex = -1 }

  // show/hide vbox
  function showVbox() {
    vbox.style.display = 'inline-block'
    vbTo.className = 'fa fa-chevron-up'
  }
  function hideVbox() {
    vbox.style.display = 'none'
    vbTo.className = 'fa fa-chevron-down'
    vid.pause()
  }
  vbTo.onclick = function(ev) {
    ev.stopPropagation()
    if (vbox.style.display == 'none') showVbox()
    else hideVbox()
  }

  // seek video
  document.getElementById('sequences').addEventListener('click', function(ev) {
    var hsm = '', path = []
    if (ev.path) path = ev.path // chrome fix removed el
    else { // rest
      var el = ev.target
      while (el != this) { path.push(el); el = el.parentElement }
    }
    for (var i=0,ii=path.length; i<ii; i++) {
      if (path[i].classList.contains('time')) {
        if (path[i].tagName == 'PRE') hsm = path[i].innerText // chrome fix removed el
        else hsm = path[i].children[0].innerText || path[i].children[0].value
        break
      } else if (path[i] == this) break
    }
    // calc sec and seek
    if (hsm) {
      var hmsList = hsm.split('.')[0].split(':'), s = 0, v = 1
      while (hmsList.length) {
        s += hmsList.pop() * v
        v *= 60
      }
      vid.currentTime = s
      vid.play()
      showVbox()
    }
  })

  // keyboard
  document.addEventListener('keyup', function(ev) {
    if (ev.ctrlKey) {
      switch (ev.code) {
        case 'Space': playPause(); break
        case 'Comma': vid.style.width = vid.offsetWidth + 50 + 'px'; break
        case 'Period': vid.style.width = vid.offsetWidth - 50 + 'px'; break
      }
    }
  })

  GM_addStyle(`
    #vbox {
      float: right;
      position: relative;
      top: -15px;
      font-size: 0;
      background-color: inherit;
    }
    #vbox::before {
      content: 'Abre o arrastra vídeo';
      display: flex;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      margin: 5%;
      border: 3px #777 dashed;
      border-radius: 20px;
      font-family: 'Open Sans', arial, sans-serif;
      font-size: 16px;
      font-weight: bold;
      color: #777;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    #vbox > video {
      position: relative;
      width: 25vw;
      max-width: 50vw;
      min-width: 300px;
      z-index: -1;
    }
    #vbox > video::cue {
      position: relative;
      bottom: 20px;
      font-family: 'Open Sans', arial, sans-serif;
      font-size: 16px;
      text-shadow: 2px 2px 2px black;
      color: white;
      background: none;
    }
    #vbTo {
      visibility: visible;
      position: absolute;
      top: 0;
      right: -15px;
      padding: 4px 8px 16px 12px;
      font-size: 18px;
      color: var(--color-blue-a);
      opacity: .5;
      cursor: pointer;
      z-index: 2;
    }
    .time > div {
      cursor: pointer;
    }
  `)
};

unsafeWindow.addEventListener("load", run);

Avatar de Usuario
grimya
Mensajes: 742
Registrado: 03 Jul 2017, 18:30
x 198

Re: Añadir vídeo a la traducción

Mensaje por grimya » 16 Ene 2021, 10:12

athk escribió:
16 Ene 2021, 00:40
No es elegante, pero mejor que roto...

Código: Seleccionar todo

// ==UserScript==
// @name Subtitulamos Video Hook
// @namespace subtitulamos
// @match https://www.subtitulamos.tv/subtitles/*/translate
// @grant GM_addStyle
// @grant GM_xmlhttpRequest
// @grant unsafeWindow
// ==/UserScript==

// SRT to WebVTT by Silvia Pfeiffer - https://silviapfeiffer.github.io
function srt2vtt(b){b=b.replace(/\r+/g,'');b=b.replace(/^\s+|\s+$/g,'');b=b.split('\n\n');var f='';if(0<b.length){f+='WEBVTT\n\n';for(var g=0;g<b.length;g+=1){var e='';for(var a=b[g].split(/\n/);3<a.length;){for(var c=3;c<a.length;c++)a[2]+='\n'+a[c];a.splice(3,a.length-3)}c=0;!a[0].match(/\d+:\d+:\d+/)&&a[1].match(/\d+:\d+:\d+/)&&(e+=a[0].match(/\w+/)+'\n',c+=1);if(a[c].match(/\d+:\d+:\d+/)){var d=a[1].match(/(\d+):(\d+):(\d+)(?:,(\d+))?\s*--?>\s*(\d+):(\d+):(\d+)(?:,(\d+))?/);d?(e+=d[1]+':'+d[2]+':'+d[3]+'.'+d[4]+' --\x3e '+d[5]+':'+d[6]+':'+d[7]+'.'+d[8]+'\n',c+=1,a[c]&&(e+=a[c]+'\n\n')):e=''}else e='';f+=e}}return f}

const run = function() {
  // create and append vbox
  var vbox = document.createElement('div')
  vbox.id = 'vbox'
  vbox.style.display = 'none'
  vbox.innerHTML = '<video controls><track default></video>'
  var vid = vbox.children[0]
  var sub = vid.children[0]
  var vbTo = document.createElement('i')
  vbTo.id = 'vbTo'
  vbTo.className = 'fa fa-chevron-down'
  document.getElementById('translation-tools').appendChild(vbox).parentElement.appendChild(vbTo)

  console.log(document.getElementById('episode-header').children[0].href);
  // get subtitle id
  GM_xmlhttpRequest({
    method: 'GET',
    url: document.getElementById('episode-header').children[0].href,
    onload: function(req) {
      var subId = /href="\/subtitles\/(\d+)\/translate"/.exec(req.responseText)[1]
      // load subtitle
      GM_xmlhttpRequest({
        method: 'GET',
        url: 'https://www.subtitulamos.tv/subtitles/'+subId+'/download',
        onload: function(req) {
          var subData = srt2vtt(req.responseText)
          var subUrl = URL.createObjectURL(new Blob([subData], {type : 'text/vtt'}))
          sub.src = subUrl
        }
      })// load subtitle
    }
  })

  // load video
  function loadVideo(vidFile) { vid.src = URL.createObjectURL(vidFile) }
  // open video
  function playPause() { (vid.paused) ? vid.play() : vid.pause() }
  vbox.onclick = function(ev) {
    if (ev.target == this) {
      var input = document.createElement('input')
      input.type = 'file'
      input.onchange = function(ev) { loadVideo(ev.target.files[0]) }
      input.click()
    } else playPause()
  }
  // drop video
  vbox.ondragover = function(ev) { ev.preventDefault() }
  vbox.ondrop = function(ev) {
    ev.preventDefault()
    loadVideo(ev.dataTransfer.items[0].getAsFile())
  }
  // video onload
  vid.oncanplay = function() { vid.style.zIndex = 1 }
  vid.onerror = function() { vid.style.zIndex = -1 }

  // show/hide vbox
  function showVbox() {
    vbox.style.display = 'inline-block'
    vbTo.className = 'fa fa-chevron-up'
  }
  function hideVbox() {
    vbox.style.display = 'none'
    vbTo.className = 'fa fa-chevron-down'
    vid.pause()
  }
  vbTo.onclick = function(ev) {
    ev.stopPropagation()
    if (vbox.style.display == 'none') showVbox()
    else hideVbox()
  }

  // seek video
  document.getElementById('sequences').addEventListener('click', function(ev) {
    var hsm = '', path = []
    if (ev.path) path = ev.path // chrome fix removed el
    else { // rest
      var el = ev.target
      while (el != this) { path.push(el); el = el.parentElement }
    }
    for (var i=0,ii=path.length; i<ii; i++) {
      if (path[i].classList.contains('time')) {
        if (path[i].tagName == 'PRE') hsm = path[i].innerText // chrome fix removed el
        else hsm = path[i].children[0].innerText || path[i].children[0].value
        break
      } else if (path[i] == this) break
    }
    // calc sec and seek
    if (hsm) {
      var hmsList = hsm.split('.')[0].split(':'), s = 0, v = 1
      while (hmsList.length) {
        s += hmsList.pop() * v
        v *= 60
      }
      vid.currentTime = s
      vid.play()
      showVbox()
    }
  })

  // keyboard
  document.addEventListener('keyup', function(ev) {
    if (ev.ctrlKey) {
      switch (ev.code) {
        case 'Space': playPause(); break
        case 'Comma': vid.style.width = vid.offsetWidth + 50 + 'px'; break
        case 'Period': vid.style.width = vid.offsetWidth - 50 + 'px'; break
      }
    }
  })

  GM_addStyle(`
    #vbox {
      float: right;
      position: relative;
      top: -15px;
      font-size: 0;
      background-color: inherit;
    }
    #vbox::before {
      content: 'Abre o arrastra vídeo';
      display: flex;
      position: absolute;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      margin: 5%;
      border: 3px #777 dashed;
      border-radius: 20px;
      font-family: 'Open Sans', arial, sans-serif;
      font-size: 16px;
      font-weight: bold;
      color: #777;
      align-items: center;
      justify-content: center;
      cursor: pointer;
    }
    #vbox > video {
      position: relative;
      width: 25vw;
      max-width: 50vw;
      min-width: 300px;
      z-index: -1;
    }
    #vbox > video::cue {
      position: relative;
      bottom: 20px;
      font-family: 'Open Sans', arial, sans-serif;
      font-size: 16px;
      text-shadow: 2px 2px 2px black;
      color: white;
      background: none;
    }
    #vbTo {
      visibility: visible;
      position: absolute;
      top: 0;
      right: -15px;
      padding: 4px 8px 16px 12px;
      font-size: 18px;
      color: var(--color-blue-a);
      opacity: .5;
      cursor: pointer;
      z-index: 2;
    }
    .time > div {
      cursor: pointer;
    }
  `)
};

unsafeWindow.addEventListener("load", run);
Estoooooo, ¿y qué hago con eso? ¿Dónde lo pongo? Instrucciones para torpes, por favor.
Imagen

Avatar de Usuario
marilynbrown2
Moderador
Mensajes: 3186
Registrado: 29 Jun 2017, 18:19
x 1014

Re: Añadir vídeo a la traducción

Mensaje por marilynbrown2 » 16 Ene 2021, 10:23

grimya escribió:
16 Ene 2021, 10:12

Estoooooo, ¿y qué hago con eso? ¿Dónde lo pongo? Instrucciones para torpes, por favor.
Lo explican al principio del hilo. Supongo que serán los mismos pasos, solo habrá cambiado el código que hay que copiar: viewtopic.php?f=10&t=544#p7899
1 x
Subtitle Together, Die Alone.

Avatar de Usuario
grimya
Mensajes: 742
Registrado: 03 Jul 2017, 18:30
x 198

Re: Añadir vídeo a la traducción

Mensaje por grimya » 16 Ene 2021, 11:13

Eh que lo he conseguido :D
Muchas gracias por el nuevo script y por las instrucciones para torpes :roll:
Lo único que no se queda el cursor como que vaya a hacer nada si pinchas en los tiempos pero si pinchas de todas formas te lleva a la secuencia. Es genial :D
Imagen

Avatar de Usuario
hotbaby
Mensajes: 536
Registrado: 03 Jul 2017, 20:32
x 154

Re: Añadir vídeo a la traducción

Mensaje por hotbaby » 16 Ene 2021, 12:45

:shock: :? Yo ni para torpes...
El amor es infinito, cuando infinitamente te aman.

Avatar de Usuario
ElenaF
Mensajes: 119
Registrado: 08 Jul 2017, 03:24
x 97

Re: Añadir vídeo a la traducción

Mensaje por ElenaF » 16 Ene 2021, 13:38

A lo mejor es solo cosa de mi pantalla pero, al abrir el vídeo, me tapa las instrucciones que más uso para traducir: abrir todo, abrir sin traducir, alinear y guardar todo. :cry:

Responder

¿Quién está conectado?

Usuarios navegando por este Foro: Google [Bot] y 12 invitados