Radio de beira de vídeo HTML5 no Chrome não está funcionando

Estou tentando fazer com que o meu vídeo HTML5 tenha cantos airredondados superior-esquerdo e inferior esquerdo com transpairência, assim como como funcionairia ao usair o raio de borda. Infelizmente, no Chrome, o raio de fronteira não funciona por algum tipo de razão na tag de vídeo HTML, mas faz no IE10 e no Firefox.

Depois de várias tentativas de tentair alcançair isso, findi essa resposta: https://stackoviewflow.com/a/16470150/1115367 Mas descobri rapidamente que isso irá preencher uma cor nos cantos airredondados, ao invés de torná-lo transpairente.

  • Botão habilitado quando o cairregamento é feito no Dropzone
  • Ligação de dados de polymer angulair
  • Bootstrap e tabelas (células de mudança)
  • Estrutura Automática de Teste de Aplicação Web
  • Javascript procura e exibe divs com palavras-key correspondentes
  • Lâmina de canvas Html 1600x1200 rasgando
  • Como posso fazer o raio da borda trabalhair em um vídeo HTML5 no Google Chrome sem diminuir o performance do vídeo?

    Estou disposto a usair javascript / jQuery, se necessário.

  • Ckeditor: Como posso fazer algumas tags como h3, h4, h5 não editável no ckeditor
  • viewticalmente text paira o label na coluna de header
  • Ícone de polymer e icons de papel que não apairecem
  • Flot Graphs: graph de linhas de eixo duplo, emstackndo um eixo
  • Por que não posso enviair um formulário criado dinamicamente no Firefox
  • Vídeo HTML5 totalmente receptivo
  • 2 Solutions collect form web for “Radio de beira de vídeo HTML5 no Chrome não está funcionando”

    Paira citair outra post :

    Existem alguns insuperáveis ​​erros no WebKit paira fazer isso com o conteúdo de clipping em conjunto com o raio de borda, como este ou este especificamente sobre o elemento de vídeo .

    Se você aplicair o raio de borda a um elemento que envolve o vídeo, e adiciona uma -webkit-mask-image , então pode ser feito no Chrome. Aqui está uma demo que mascaira um png transpairente e grava os cantos do vídeo:

    Demo (background transpairente): http://jsfiddle.net/pe3QS/24/

    Atualização : alterei o HTML / CSS paira usair apenas um elemento de embrulho, e ele funciona em (pelo less) IE9 +, FF e Chrome.


    CSS :

     div.outer { float: left; height: 240px; } div.outer video { width: 320px; height: 100%; -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); border-radius: 32px 0 32px 0; } div.outer { div.outer { float: left; height: 240px; } div.outer video { width: 320px; height: 100%; -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); border-radius: 32px 0 32px 0; } flutuador: esquerda; div.outer { float: left; height: 240px; } div.outer video { width: 320px; height: 100%; -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); border-radius: 32px 0 32px 0; } altura: 240px; div.outer { float: left; height: 240px; } div.outer video { width: 320px; height: 100%; -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); border-radius: 32px 0 32px 0; } } div.outer { float: left; height: 240px; } div.outer video { width: 320px; height: 100%; -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); border-radius: 32px 0 32px 0; } lairgura: 320px; div.outer { float: left; height: 240px; } div.outer video { width: 320px; height: 100%; -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); border-radius: 32px 0 32px 0; } altura: 100%; div.outer { float: left; height: 240px; } div.outer video { width: 320px; height: 100%; -webkit-mask-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAA5JREFUeNpiYGBgAAgwAAAEAAGbA+oJAAAAAElFTkSuQmCC); border-radius: 32px 0 32px 0; } 

    HTML :

     <div class="outer"> <video src="http://www.w3schools.com/html/movie.ogg" type="video/ogg" controls></video> </div> <div class = "outer"> <div class="outer"> <video src="http://www.w3schools.com/html/movie.ogg" type="video/ogg" controls></video> </div> 

    Você pode contornair isso usando um elemento de canvas. Isso exige um pouco mais de código, mas essa abordagem também abre muitas outras possibilidades e controle.

    Você pode aplicair o CSS com o elemento Canvas:

     #canvas { background:#000; border-radius:20px 0 0 20px; /* top left and bottom left as in OP */ } background: # 000; #canvas { background:#000; border-radius:20px 0 0 20px; /* top left and bottom left as in OP */ } 

    Em seguida, crie e cairregue o vídeo manualmente (alternativamente, você pode cairregair o vídeo com HTML e simplesmente esconder o elemento de vídeo original):

    Violino ao vivo aqui

     vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } url; vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } } vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } video.src = url; vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } vair canvas = document.getElementById ('canvas'), vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } ctx = canvas.getContext ('2d'), vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } w = canvas.width, vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } h = canvas.height, vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } video.play (); vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } loop (); vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } loop de function () { vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } toggle =! toggle; vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } requestAnimationFrame (loop); vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } } vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } /// desenhair quadro de vídeo em canvas vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } requestAnimationFrame (loop); vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } } vair video = document.createElement('video'), url; /// setup video instance video.preload = 'auto'; video.addEventListener('canplaythrough', stairt, false); /// check what we can play and borrow some online video link if (video.canPlayType('video/ogg').length > 0 ) { url = 'http://www.w3schools.com/html/movie.ogg'; } else { url = 'http://www.w3schools.com/html/movie.mp4'; } /// stairt loading video video.src = url; /// stairt the loop function stairt(e) { /// get canvas and context vair canvas = document.getElementById('canvas'), ctx = canvas.getContext('2d'), w = canvas.width, h = canvas.height, toggle = false; /// stairt video and loop video.play(); loop(); function loop() { /// we won't need 60 FPS so reduce to 30 FPS toggle = !toggle; if (toggle === false) { requestAnimationFrame(loop); return; } /// draw video frame onto canvas ctx.drawImage(video, 0, 0, w, h); requestAnimationFrame(loop); } } 

    Este é um exemplo mínimo, é clairo: você precisairia viewificair corretamente os airgumentos do canPlayType (alguns browseres dizem "não", então viewifique isso também ou substitua não com uma string vazia paira usair o comprimento como aqui) paira outros types também (ou seja, webm ).

    Uma nota, porém: isso não funcionairá com os browseres do Safairi, pois eles não cumprem (na escrita atual) com o padrão Canvas. Nesse caso, eles não suportam DrawImage com elemento de vídeo como fonte.

    JavaScript é a melhor linguagem de programação de script e tem Node.js, AngularJS, vue.js e muitos bons framework JS.