
jw6: crossdomain error when attempt to load youtube video
I am attempting to migrate from jw5 to jw6. With jw5, I have no problem playing youtube videos. With jw6, I am able to load a youtube video if it is loaded at the same time the jwplayer is created. But when I attempt to load a youtube video after the player has been created, I get a crossdomain error: "Playlist could not be loaded: Crossdomain loading denied".
Here is the script. Note that the video "youtube1" successfully loads during setup, and the video "youtube2" fails to load when the user clicks on the box.
bc.. <style>
#box{
width: 50px;
height: 50px;
background-color: #FFFF66;
}
</style>
<body>
<div id='content'>
<div id='container'></div>
<div id='box'></div>
</div>
</body>
<script type="text/javascript">
$(document).ready(function() {
var youtube1 = 'https://www.youtube.com/watch?v=fljKx9nvrL4';
var youtube2 = 'https://www.youtube.com/watch?v=S3OJOGxy21k';
var myflashplayer = './jwplayer.flash.swf';
var params = {height: 200, width: 300, file: youtube1, flashplayer: myflashplayer};
var myplayer = jwplayer('container').setup(params);
$('#box').click(function() {
myplayer.load(youtube2);
});
});
</script>