I have a carousel with images and videos I have decided to give autoplay to the videos the problem that I have is that when I load the page in which the carousel is automatically reproduced the video I would need it to be automatically reproduced when it is positioned in its corresponding slide the problem is that I do not know how to do it.
<div id="carousel" class="carousel slide" data-ride="carousel">
<div class="carousel-inner" role="listbox">
@{bool Activo = true;}
@foreach (var item in Model.ListaImagen)
{
<div class="item @(Activo ? "active" : "")">
<img class="img-responsive center-block" src="/content/images/@(item.Archivo)" alt="">
</div>
Activo = false;
}
@foreach (var item in Model.ListaVideo)
{
<div class="item" style="text-align: center;">
<video style="margin-bottom: 100px;" width="auto" height="500px" controls autoplay>
<source src="/content/images/@(item.Archivo)" type="video/mp4">
</video>
</div>
}
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel" role="button" data-slide="prev" ">
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#carousel" role="button" data-slide="next" ">
<span class="sr-only">Next</span>
</a>
</div>