On Tue, Aug 14, 2012 at 5:22 AM, Renaud Chénard <[email protected]> wrote:
> I'm not sure of how to use the code-form...
>
> Let's take an example :
>
> <code>
> video = Video()
> # let's make a test to be sure that the browser could read the file :
> if video.canPlayType('video/ogv'):
>     video.setSrc('toto.ogv')
> elif video.canPlayType('video/mp4'):
>     video.setSrc('toto.mp4')
> video.play()
> </code>
>
> I know it could be done automaticaly by the browser if i use addSrc, but i
> want to be able to change the source of the Video, so i think i'm oblige to
> use setSrc.

i didnt write this, nor am i that familiar with the <video> tag, but
the code is this:

    def setSrc(self, src):
        DOM.setAttribute(self.getElement(), 'src', src)

    def addSrc(self, src):
        s = DOM.createElement("source")
        DOM.setAttribute(s, 'src', src)
        DOM.appendChild(self.getElement(), s)

... so it looks like there is a <source> tag that you'll need to
manages yourself?

-- 

C Anthony

-- 



Reply via email to