Last active
January 22, 2018 19:54
-
-
Save henriqueog/f21634d086a117d2d234 to your computer and use it in GitHub Desktop.
Capture video file name and data-id
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//classe dos elementos DIV que contem o vídeo | |
//k-u-P-m | |
//o attribute que precisamos para pegar o id do vídeo | |
//data-id | |
//pegando os vídeos | |
VideoElements = document.getElementsByClassName('k-u-P-m'); | |
for (var i = 0, total = VideoElements.length; i < total; i++) { | |
//pegando o nome do arquivo do attribute aria-label, apenas para nossa identificação | |
//pegando o id do vídeo para inserção no iframe | |
console.log('Nome: '+VideoElements.item(i).children[2].getAttribute('aria-label')+' - id para iframe: '+VideoElements.item(i).getAttribute('data-id')); | |
}; | |
/* | |
//url para download(usuários permitidos) | |
'https://drive.google.com/open?id='[data-id]'+&authuser=1' | |
//montagem do iframe para inserção no BB | |
<div class="embed-responsive embed-responsive-4by3"><iframe width="640" height="480" src="https://drive.google.com/a/brazcubas.edu.br/file/d/"+[data-id]+"/preview" frameborder="0" allowfullscreen=""></iframe></div> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment