HTML5 in the process of operation, a lot of friends will encounter a problem, that is, when playing local files, there are often some problems, so that the HTML5 operation of the local file playback is not smooth or is not able to play normally. Now, let's see how HTML5 plays local files.
The code example is as follows:
<body>
<input type= "file" id= "file" >
<audio id= "audio_id" controls AutoPlay Loop>your browser can ' t support HTML5 audio</audio>
<script>
function Oninputfilechange () {
var file = document.getElementById (' file '). Files[0];
var url = url.createobjecturl (file);
console.log (URL);
document.getElementById ("audio_id"). src = URL;
}
</script>
</body>
<ul class= "pagination" >
<li><a href= "#" >«</a></li>
<li><a href= "#" >1</a></li>
<li><a href= "#" >2</a></li>
<li><a href= "#" >3</a></li>
<li><a href= "#" >4</a></li>
<li><a href= "#" >5</a></li>
<li><a href= "#" >»</a></li>
</ul>
links can be customized in different situations. For links that cannot be clicked with. Disabled and with. Active display is the current page.
<ul class= "pagination" >
<li class= "disabled" ><a href= "#" >«</a></li>
<li class= "active" ><a href= "#" >1</a></li>
<li><a href= "#" >2</a></li>
<li><a href= "#" >3</a></li>
<li><a href= "#" >4</a></li>
<li><a href= "#" >5</a></li>
<li><a href= "#" >»</a></li>
</ul>
You can also apply active or disabled to the <span> tag so that you can keep the style you want and remove the click Feature.
<ul class= "pagination" >
<li class= "disabled" ><a href= "#" >«</a></li>
<li class= "active" ><span>1 <span class= "sr-only" > (current) </span></span></li >
<li><a href= "#" >2</a></li>
<li><a href= "#" >3</a></li>
<li><a href= "#" >4</a></li>
<li><a href= "#" >5</a></li>
<li><a href= "#" >»</a></li>
</ul>
want a smaller or larger paging? To get more dimensions, add. pagination-lg or. PAGINATION-SM Bar.
<p></p>
<ul class= "pagination Pagination-lg" >
<li class= "disabled" ><a href= "#" >«</a></li>
<li class= "active" ><span>1 <span class= "sr-only" > (current) </span></span></li >
<li><a href= "#" >2</a></li>
<li><a href= "#" >3</a></li>
<li><a href= "#" >4</a></li>
<li><a href= "#" >5</a></li>
<li><a href= "#" >»</a></li>
</ul>
<p></p>
<ul class= "pagination" >
<li class= "disabled" ><a href= "#" >«</a></li>
<li class= "active" ><span>1 <span class= "sr-only" > (current) </span></span></li >
<li><a href= "#" >2</a></li>
<li><a href= "#" >3</a></li>
<li><a href= "#" >4</a></li>
<li><a href= "#" >5</a></li>
<li><a href= "#" >»</a></li>
</ul>
<p></p>
<ul class= "pagination pagination-sm" >
<li class= "disabled" ><a href= "#" >«</a></li>
<li class= "active" ><span>1 <span class= "sr-only" > (current) </span></span></li >
<li><a href= "#" >2</a></li>
<li><a href= "#" >3</a></li>
<li><a href= "#" >4</a></li>
<li><a href= "#" >5</a></li>
<li><a href= "#" >»</a></li>
The code that HTML5 how to play the local file is the above content. Everyone in the operation of the relevant issues may wish to take a look at the above introduction, can help themselves in the completion of the HTML5 local file play operation code to get some help. More about HTML5 local file playback problems can be viewed directly on the professional website, to obtain more professional solutions. However, the answer to the simple question of local file playback on HTML5 is the above-mentioned content.