0

this code here works if the src is filled with my videolink

<object width="620" height="348">
    <param name="allowfullscreen" value="true"/>
    <param name="allowscriptaccess" value="always"/>
    <embed src="myvideolink...." type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="620" height="348"/>
</object>

now my next step is to fill it via javascript

$('a.videolink, a.videobutton, a.articlevideobutton').click(function(event){
    event.preventDefault();
    $('.video object embed').attr('src', $(this).attr('href'));
});

but this isnt working... empty flash is displayed. but the generated source code seems ok. the href of the link is in the src attribute of the ebmed tag.

EDIT: i did this now. source code is correct again but still not playing my video

$('a.videolink, a.videobutton, a.articlevideobutton').click(function(event){
    event.preventDefault();
    $('.video').append('<object width="620" height="348"><param name="allowfullscreen" value="true"/><param name="allowscriptaccess" value="always"/><embed src="'+$(this).attr('href')+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="620" height="348"/></object>');
});
ggzone
  • 3,661
  • 8
  • 36
  • 59

1 Answers1

0

Its better to replace the entire html with the new src,

See this answer, JavaScript: Changing src-attribute of a embed-tag

Community
  • 1
  • 1
Jim Jose
  • 1,319
  • 11
  • 17
  • it worked with reinserting the whole object tag... and i also used a broken link from customer *holy*... that was the second problem – ggzone Dec 06 '11 at 13:13