Hello, moderator:
Below there is a piece of the source code only for explanation. It's a sample of how a person could to extract the video properties from a video file. I suppose that the javascript code doesn't work perhaps because the javascript library is not updated, or it is partially damaged. Its version which i am using now is
'jquery-1.11.3.min.js'! ( it is on server directory )
All these video files showed below plays normally without problems, through javascript code which i've included into my web page.
Thanks for attention.
---------------------------------------
<body>
<scritpt>
function info_video(){
var v=document.getElementById("myVideo");
var erro,texto_1,texto_2;
frase="";erro=false;texto_1="";texto_2="";
if(Logged == 0){ //It says:"you're not registered for the site, or didn't do your LOGIN for using this option!"
alert("Você não está cadastrado para o site, ou não fêz o seu login para usufruir desta opção!");erro=true;
}else{ //It says:"Type a number which identify a vídeo file wanted[1..8]:"
frase= prompt("Digite um número que identifica o vídeo desejado[1..8]:","1");
if(frase == null){
alert("Opção inválida!"); // It says:"Invalid option!
erro=true;
}else{
switch(frase){
case "1":
texto_1 = "Propriedades do 1º vídeo:nn";v.src="The_Addams_Family01.mp4";break;
case "2":
texto_1 = "Propriedades do 2º vídeo:nn";v.src="The_Addams_Family02.mp4";break;
case "3":
texto_1 = "Propriedades do 3º vídeo:nn";v.src="The_Addams_Family03.mp4";break;
case "4":
texto_1 = "Propriedades do 4º vídeo:nn";v.src="The_Addams_Family04.mp4";break;
case "5":
texto_1 = "Propriedades do 5º vídeo:nn";v.src="The_Addams_Family05.mp4";break;
case "6":
texto_1 = "Propriedades do 6º vídeo:nn";v.src="The_Addams_Family06.mp4";break;
case "7":
texto_1 = "Propriedades do 7º vídeo:nn";v.src="The_Addams_Family07.mp4";break;
case "8":
texto_1 = "Propriedades do 8º vídeo:nn";v.src="The_Addams_Family08.mp4";break;
default:
erro=true;alert("Opção fora da faixa!"); // It says:"The option is out of range!"
}
}
}
if( erro == true){
alert("Tente novamente mais tarde..."); // It says:"Try again later..."
}else{
v.load(); // It says:"Amount of audio tracks"
texto_1 +="a)Número de trilhas de áudio:[" + v.audioTracks.length+"]n___________________________________n";
// It says:"Amount fo text tracks"
texto_2 +="b)Número de trilhas de texto:[" + v.textTracks.length +"]n___________________________________n";
for(count=0;count < v.audioTracks.length;count++){ // It says:"The 'n' audio track uses language..."
texto_1 +="A " + (count+1).toFixed(0) +"ª trilha de áudio usa o idioma '" + v.audioTracks[count].language + "', ";
if(v.audioTracks[count].enabled == false){
texto_1 +="e não está habilitada;"; // It says:"and is not enabled;"
}else{
texto_1 +="e está habilitada;"; // It says:"and is enabled;"
}
} //fim-para
// requer o arquivo (.vtt) a pesquisa das trilhas de texto. It says that the (.vtt) file is required, although i do not know how to apply it.
for(count=0;count < v.textTracks.length;count++){ // It says:"The 'n' text track uses the language..."
texto_2 +="A " + (count+1).toFixed(0) +"ª trilha de texto usa o idioma '" + v.textTracks[count].language + "', ";
if(v.textTracks[count].mode == "disabled"){
texto_2 +="e está desabilitada;"; // It says:"and is disabled;"
}
if(v.textTracks[count].mode == "hidden"){
texto_2 +="e está oculta;"; // It says:"and is not visible;"
}
if(v.textTracks[count].mode == "showing"){
texto_2 +="e está visível;"; // It says:"and is visible;"
}
} //fim-para
alert(texto_1);alert(texto_2);alert(v.error.code);
// switch(v.error.code){
// case 0:alert("Nenhum êrro ocorrido até o momento."); // It says:"There's no error until the moment."
// It says:" There was an error while the file was being downloaded from the server for the station host. File corrupted."
// case 2:alert("Ocorreu um êrro quando o arquivo estava sendo baixado do servidor para a estação. Arquivo corrompido.");
// It says:" There was an error while the file was being decoding to be showed."
// case 3:alert("Ocorreu um êrro quando o arquivo estava sendo decodificado para exibição.");
// It says:" Invalid file name or file not found."
// case 4:alert("Nome de arquivo inválido ou arquivo não encontrado. ");
// }
v_info=true;
} //fim-se
}
</script>
<button onclick="info_video()" type="button">Video properties</button>
<video id="myVideo" width="200" height="150" poster="The_Addams_Family.jpg" onended="video_played()">
<source src="The_Addams_Family01.mp4" type="video/mp4">
<source src="The_Addams_Family02.mp4" type="video/mp4">
<source src="The_Addams_Family03.mp4" type="video/mp4">
<source src="The_Addams_Family04.mp4" type="video/mp4">
<source src="The_Addams_Family05.mp4" type="video/mp4">
<source src="The_Addams_Family06.mp4" type="video/mp4">
<source src="The_Addams_Family07.mp4" type="video/mp4">
<source src="The_Addams_Family08.mp4" type="video/mp4">
Your browser doesn't support video based on HTML5!
</video>
</body>
------------------X-------------------