0

This is my view page. I have to play mpeg, mp4,mkv files based on my file format , which are stored in foreach loop. BUt its not working. Plesae help how will I implement this? I have to play all these three file format on my view page.

<div style="width:98%;float:left; height:auto;margin:0 1%;">

@foreach (string vidf in Model.SVideo)
{
    string[] arr = new string[@Model.SVideo.Count()];
    string ss = @vidf.ToString();
    arr = @vidf.Split('.');
    string ext =arr[1];
    if (ext != "mpeg")
    {
<div style="width:295px;display:inline-block;margin:10px 5px;">

        <video width="320" height="240" poster="poster.jpg" controls="controls" preload="none">
        <source type="video/mp4" src="@vidf" />  
        <track kind="subtitles" src="subtitles.srt" srclang="en" />
        <track kind="chapters" src="chapters.srt" srclang="en" />    
        </video>

 </div> 
    }
    else
    {
        <object id="MediaPlayer1" CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"
        standby="Loading Microsoft Windows® Media Player components..." type="application/x-oleobject" width="280" height="256">
        <param name="fileName" value="@vidf">
        <param name="animationatStart" value="true">
        <param name="transparentatStart" value="true">
        <param name="autoStart" value="true">
        <param name="showControls" value="true">
        <param name="Volume" value="-450">
        <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="@vidf" name="MediaPlayer1" width=280 height=256 autostart=1 showcontrols=1 volume=-450>
        </object>
    }        
}
</div>
Abhay Singh
  • 1,595
  • 1
  • 23
  • 40

0 Answers0