I have an ASP website that plays videos depending on the HTTP 'id' parameter
Server side:
Public vidurl As String Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim id As String = Request.QueryString("id") Dim DT As New DataTable Dim vidInfo As VideoInfo Try If id IsNot Nothing Then Dim SQLConnection_Cont As New SqlConnection(SQLConntStr) DT = f.GetVideoInfo(id, SQLConnection_Cont) If DT IsNot Nothing Then If DT.Rows.Count > 0 Then vidInfo = New VideoInfo With { .ID = DT.Rows(0).Item("FTPID"), .Processed = DT.Rows(0).Item("Processed"), .URL = DT.Rows(0).Item("URL"), .VideoName = DT.Rows(0).Item("VideoName"), .VidID = DT.Rows(0).Item("VidID"), .Created = DT.Rows(0).Item("Created"), .MonthDiff = DT.Rows(0).Item("Monthdiff")} If vidInfo.MonthDiff = 0 Then vidurl = "http://webpath.com/virtualdirectory/content/" & vidInfo.VideoName End If End If End If End If Catch ex As Exception WriteExToFile("Video.aspx.vb", ex.ToString) End Try End Sub
Client side:
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Video Player</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" runat="server"> <div> <div id="vidplay"> <video height="400" controls style="position: relative; top: 23px;"> <source src=<%= vidurl %> type="video/mp4" codecs="avc1.42E01E, mp4a.40.2"/> <object data=src=<%= vidurl %> width="320" height="240"></object> </video> </div> </div> </form> </body> </html>
So, I pass the video path in the virtual directory in the global variable vidurl
When I play it in Google Chrome for the desktop, I only hear the sound in the video with a black image.
When I play it on a mobile device, a black video appears, but it does not play at all.
What could be the problem?
Please note that all videos in the virtual directory are in mp4 format.
UPDATE:
I went to the codec info in my video,
It says: MPEG-4 Video (mp4v)
Maybe a problem?
The priority is for the video to work on mobile phones.