I achieved that for default html videos thanks to my question: HTML video pause when window is minimized
But now I started to use a video preparation application that generates videos with some additional features(subtitles, search in subtitle etc...)
And the html file generated by that application includes IFrame. I tried onfocus()-offocus() function on Iframe but it did not worked. I could not achieve pausing video when the tab is changed or window is minimized.
Here is default code that is generated by video preparation tool. How can apply that solution (in the link at the beginning) to this code ? What is the difference between IFrame object and video for javascript?
not: This is the first html file that I run to open page with videos. It calls other files. I am not sure whether you need these files to see or not.
<!DOCTYPE HTML>
<html>
<head>
<meta name="google" value="notranslate" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>TEST VIDEO</title>
<style>
html, body {
margin: 0px;
padding: 0px;
font-family:Verdana, Geneva, sans-serif;
background-color: #1a1a1a;
text-align: center;
width: 100%;
height: 100%;
}
</style>
<link href="TEST_embed.css" rel="stylesheet" type="text/css">
</head>
<body>
<iframe class="tscplayer_inline" id="embeddedSmartPlayerInstance" src="TEST_player.html?embedIFrameId=embeddedSmartPlayerInstance" scrolling="no" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>
</body>
</html>