}
// Add HTML5 video element
- if (typeItem.name === 'Video' && data.video.sources[0]) {
+ if (typeItem.name === 'Video' && data.video.sources && data.video.sources[0]) {
// Create new object element
video = new Node('video', 1).attr(tinymce.extend({
id : node.attr('id'),
}
// Add HTML5 audio element
- if (typeItem.name === 'Audio' && data.video.sources[0]) {
+ if (typeItem.name === 'Audio' && data.video.sources && data.video.sources[0]) {
// Create new object element
audio = new Node('audio', 1).attr(tinymce.extend({
id : node.attr('id'),
type: typeItem.mimes[0]
});
} else {
- object.attr({
- classid: "clsid:" + typeItem.clsids[0],
- codebase: typeItem.codebase
- });
+ if ( typeItem.clsids )
+ object.attr('clsid', typeItem.clsids[0]);
+ object.attr('codebase', typeItem.codebase);
embed = new Node('embed', 1);
embed.shortEnded = true;