In this scenario where data-property exists, but the containment is listed in the options, the player will never be displayed.
Here is why! When data-property is set, this is line executed, but since the self reference is not yet defined at all, containment gets set to an empty jQuery result.
YTPlayer.property.containment = YTPlayer.property.containment == "self" ? $YTPlayer : jQuery(YTPlayer.property.containment);
Then when this occurs, the value specified in options is now replaced by incorrect empty jQuery value in YTPlayer.property.
jQuery.extend(YTPlayer.opt,jQuery.mbYTPlayer.defaults, options, YTPlayer.property);
The workaround is to put containment in data-property, which isn't a big deal.
I did a little testing to try for a workaround. Seems like that first line could actually be removed, and the final determination should be before or after this:
YTPlayer.isPlayer = YTPlayer.opt.containment == "self" || ($YTPlayer.is (YTPlayer.opt.containment));
Specifically, this situation does not work correctly.
<div id="ytplayer" data-property="{videoURL:'http://youtu.be/BsekcY04xvQ'></div> jQuery("#ytplayer").YTPlaylist({containment:'self'});
In this scenario where data-property exists, but the containment is listed in the options, the player will never be displayed.
Here is why! When data-property is set, this is line executed, but since the self reference is not yet defined at all, containment gets set to an empty jQuery result.
YTPlayer.property.containment = YTPlayer.property.containment == "self" ? $YTPlayer : jQuery(YTPlayer.property.containment);
Then when this occurs, the value specified in options is now replaced by incorrect empty jQuery value in YTPlayer.property.
jQuery.extend(YTPlayer.opt,jQuery.mbYTPlayer.defaults, options, YTPlayer.property);
The workaround is to put containment in data-property, which isn't a big deal.
I did a little testing to try for a workaround. Seems like that first line could actually be removed, and the final determination should be before or after this:
YTPlayer.isPlayer = YTPlayer.opt.containment == "self" || ($YTPlayer.is (YTPlayer.opt.containment));
Joel