0

I'm using html5 video to display a video on my website. I am able to use Javascript to get and set the currentTime property, but this functionality disappears when I add

runat="server"

to the video. If I don't include it, I am unable to use code such as

MyVideo.Attributes["src"] = "Videos/" + video_id + ".mp4";

in the code-behind file. Is there a way that I can maintain the functionality of the javascript code (seeking, setting current time, etc) and still set the source through the code-behind file?

David B
  • 147
  • 1
  • 11
  • 1
    You always can use declarative approach I can't say more without your code and further explanations about what exactly does not work. – Tommi May 15 '13 at 14:32
  • Using ContentPlaceHolder_Body_MyVideo instead of MyVideo makes it work, but I'm worried that this isn't the best solution. Any help is welcome. – David B May 15 '13 at 14:36
  • 1
    You say "Using ContentPlaceHolder_Body_MyVideo">. I assume you can't find your video tag from client script because server changes it for it's purposes when you set runat="server". Read this question to know how to get proper element ID from client-side: http://stackoverflow.com/questions/5666011/retrieve-id-of-server-control-using-jquery – Tommi May 15 '13 at 14:44

0 Answers0