Link to home
Start Free TrialLog in
Avatar of kperelman
kperelman

asked on

changing html5 video attributes

I have this mark up to change the video tag attributes:

Video File Name: <%= sampleVar%>
<video id="Video1" controls="controls" autoplay="<%= autoPlayVar%>"  >
  <source src="<%= sampleVar%>.ogv"  type="video/ogg" />
  <source src="<%= sampleVar%>.webm" type="video/webm" />
  <source src="<%= sampleVar%>.mp4" type="video/mp4" / >
</video>  

in my vb.net code behind pageload event, I have
autoplayvar="true"
samplevar="samplevideo"
me.databind

When I bring up the page I see
Video File Name: samplevideo

This is what I would expect to see so the samplevar variable is getting set, but the video control shows 'invalid source' and does not work.

But if I replace the <%= sampleVar%> markup with the text of "samplevideo", all works fine and as it should.

So what is not right?  Is this the wrong event due to timing to use in the code behind?
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kperelman
kperelman

ASKER

Thanks for your help.
I am not sure my post was an answer but if it helped you - you are welcome.

Did you find the problem?