Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2005-10-26 06:57:45

c0
Xinha Community Member
Registered: 2005-09-01
Posts: 25
Website

Xinha corrupts EMBED tags

Copy & paste this in Xinha HTML source editor.
After saving & reopening, everything between EMBED tags is gone.


<OBJECT ID="MediaPlayer" WIDTH=320 HEIGHT=300 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject">
<PARAM NAME="FileName" VALUE="http://medias.danerd.com/videos/ggv27sbpj1/danerd.com_clip_1170.wmv">
<PARAM NAME="ShowControls" VALUE="1">
<PARAM NAME="ShowDisplay" VALUE="0">
<PARAM NAME="ShowStatusBar" VALUE="1">
<PARAM NAME="autoStart" value="1">
<PARAM NAME="Autorewind" VALUE="1">
<PARAM NAME="AutoSize" VALUE="0">
<Embed type="application/x-mplayer2"
    pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"
    filename="http://medias.danerd.com/videos/ggv27sbpj1/danerd.com_clip_1170.wmv"
    src="http://medias.danerd.com/videos/ggv27sbpj1/danerd.com_clip_1170.wmv"
    Name=MediaPlayer
    ShowControls=1
    ShowDisplay=0
    ShowStatusBar=0
    width=320
    height=300>
</embed>
</OBJECT>

Offline

#2 2005-10-26 09:02:49

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Xinha corrupts EMBED tags

Use the GetHTML plugin to fix this, or if you don't want to use a plugin, fix the problem in htmlarea.js to make Xinha work with embeded media(it's easy!):

In HTMLArea.js look for three lines that say:

      if (outputRoot)
        html += (HTMLArea.is_ie ? ('\n' + indent) : '') + "</head>";
      break;

paste the code below after it (line 4738 in today's download) and any embeded media will naturally work in Xinha.




} else if (HTMLArea.is_ie && root_tag == "object") {
            if (outputRoot)
                html += "<object";
               
            closed = (!(root.hasChildNodes() || HTMLArea.needsClosingTag(root)));
            html = "<" + root.tagName.toLowerCase();
            var attrs = root.attributes;
            for (i = 0; i < attrs.length; ++i) {
                var a = attrs.item(i);
                if (!a.specified) {
                    continue;
                }

                var name = a.nodeName.toLowerCase();
                if (/_moz|contenteditable|_msh/.test(name)) {
                    // avoid certain attributes
                    continue;
                }
                var value;
                if (name != "style") {
                    if (typeof root[a.nodeName] != "undefined" && name != "href" && name != "src" && name !="onclick" && name !="onmouseover" && name !="onmouseout" && name !="onmousedown") {
                        value = root[a.nodeName];
                    } else {
                        value = a.nodeValue;
                       
                        if (HTMLArea.is_ie && (name == "href" || name == "src")) {
                            value = editor.stripBaseURL(value);
                        }
                    }
                } else {
                    value = root.style.cssText;
                }
                if (/(_moz|^$)/.test(value)) {
                   
                    continue;
                }
               
                html += " " + name + '="' + value + '"';
            }

        html += closed ? " />" : ">";
            // lowercasize
            var save_multiline = RegExp.multiline;
            RegExp.multiline = true;
            var txt = root.innerHTML.replace(HTMLArea.RE_tagName, function(str, p1, p2) {
                return p1 + p2.toLowerCase();
            });
            RegExp.multiline = save_multiline;
            html += txt;
            if (outputRoot)
                html += "</object>";
            break;

This is from my Tue Jun 7 06:03:26 2005 entry in ticket 287, and it still works like a charm!

Offline

#3 2005-10-27 11:50:02

c0
Xinha Community Member
Registered: 2005-09-01
Posts: 25
Website

Re: Xinha corrupts EMBED tags

I humbly bow my head in admiration for your complete solution offered.

Thanks for the time & effort of looking into the matter.

===

If you have some time left:
http://coeleveld.nl/idb/admin.php
Select "contents", "content01", click edit icon, Xinha appears; insert image; uploader doesn't work.
I can arrange for SSH access.
By the way; the entire site framework is PHP/MySQL and completely free of charge / free for use by anyone.
Have a look around.
My contact details are on the site.
http://coeleveld.nl/idb = test site; if damaged beyond repair, I can rebuild from database with 1 mouseclick.
http://coeleveld.nl = live site.
Uses chains of PHP scripts which in turn use HTML templates for all HTML stuff.
Supports plugins (well, more or less), css, themes, blog style pages ('feeds'), product placement style pages, menubuilder, sitebuilder, pagebuilder, xinha, integrated uploader (recoded FileThingie PHP script), etc.
Am showing off a bit + isn't all as great as it sounds really (well, perhaps it is...).
Thanks + bye.

Offline

#4 2005-10-29 09:33:19

c0
Xinha Community Member
Registered: 2005-09-01
Posts: 25
Website

Re: Xinha corrupts EMBED tags

Can't get GetHtml plugin to work.  If I add it to my plugins section in the config, Xinha no longer launches.
Also, if I add the code in htmlarea.js, the embed tags are preserved, but things are still corrupted:

Before:
<OBJECT ID="MediaPlayer" WIDTH=320 HEIGHT=300 classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"
standby="Loading Microsoft Windows Media Player components..."
type="application/x-oleobject">
<PARAM NAME="FileName" VALUE="uploads/movies/overtake_catchup">
<PARAM NAME="ShowControls" VALUE="1">
<PARAM NAME="ShowDisplay" VALUE="0">
<PARAM NAME="ShowStatusBar" VALUE="1">
<PARAM NAME="autoStart" value="1">
<PARAM NAME="Autorewind" VALUE="1">
<PARAM NAME="AutoSize" VALUE="0">
<Embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"
filename="uploads/movies/overtake_catchup.wmv"
src="uploads/movies/overtake_catchup.wmv"
Name=MediaPlayer
ShowControls=1
ShowDisplay=0
ShowStatusBar=0
width=320
height=240></embed></OBJECT>

After:
<object id="MediaPlayer" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" type="application/x-oleobject" height="300" standby="Loading Microsoft Windows Media Player components..." width="320" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" />
<embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"
filename="uploads/movies/overtake_catchup.wmv"
src="uploads/movies/overtake_catchup.wmv" Name=MediaPlayerShowControls=1
ShowDisplay=0 ShowStatusBar=0 width=320 height=240></embed></object>


I don't want Xinha to mess up the syntax !

Offline

#5 2005-10-30 01:33:29

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Xinha corrupts EMBED tags

What you say is true... and when I try your example using the GetHtml plugin I get:

<object id="MediaPlayer" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" type="application/x-oleobject" height="300" standby="Loading Microsoft Windows Media Player components..." width="320" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
      <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" filename="uploads/movies/overtake_catchup.wmv" src="uploads/movies/overtake_catchup.wmv"Name="MediaPlayerShowControls=1" showdisplay="0ShowStatusBar=0width=320height=240" /></embed>
    </object>

Offline

#6 2005-10-30 02:10:51

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Xinha corrupts EMBED tags

It seems that neither solution is allowing there to be param tags in the object.

If this would work for you, this seems to work with both solutions:

<object id=MediaPlayer codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112 type=application/x-oleobject height=300 standby="Loading Microsoft Windows Media Player components..." width=320 classid=CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95 autosize="0" autorewind="1" autostart="1" showstatusbar="1" showdisplay="0" showcontrols="1" filename="uploads/movies/overtake_catchup">

      <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" filename="uploads/movies/overtake_catchup.wmv" src="uploads/movies/overtake_catchup.wmv"Name="MediaPlayer" showcontrols="1" showdisplay="0" showstatusbar="0" width="320" height="240"></embed>
    </object>

Offline

#7 2005-10-30 02:22:57

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Xinha corrupts EMBED tags

When I try this with Flash, using this as my examplecode:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="550" height="400" id="getURL" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="getURL.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="getURL.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="getURL" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

I get this from the GetHtml plugin:

    <object id="getURL" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" height="400" width="550" align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
      <param name="_cx" value="14552" />
      <param name="_cy" value="10583" />
      <param name="FlashVars" VALUE="" />
      <param name="Movie" value="getURL.swf" />
      <param name="Src" value="getURL.swf" />
      <param name="WMode" value="Window" />
      <param name="Play" value="-1" />
      <param name="Loop" value="-1" />
      <param name="Quality" value="High" />
      <param name="SAlign" VALUE="" />
      <param name="Menu" value="-1" />
      <param name="Base" VALUE="" />
      <param name="AllowScriptAccess" value="sameDomain" />
      <param name="Scale" value="ShowAll" />
      <param name="DeviceFont" value="0" />
      <param name="EmbedMovie" value="0" />
      <param name="BGColor" value="FFFFFF" />
      <param name="SWRemote" VALUE="" />
      <param name="MovieData" VALUE="" />
      <param name="SeamlessTabbing" value="1" />
      <embed src="getURL.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="getURL" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>

And this from the extended getHtml:

<object id=getURL codeBase=http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0 height=400 width=550 align=middle classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000><param NAME="_cx" VALUE="14552"><param NAME="_cy" VALUE="10583"><param NAME="FlashVars" VALUE=""><param NAME="Movie" VALUE="getURL.swf"><param NAME="Src" VALUE="getURL.swf"><param NAME="WMode" VALUE="Window"><param NAME="Play" VALUE="-1"><param NAME="Loop" VALUE="-1"><param NAME="Quality" VALUE="High"><param NAME="SAlign" VALUE=""><param NAME="Menu" VALUE="-1"><param NAME="Base" VALUE=""><param NAME="AllowScriptAccess" VALUE="sameDomain"><param NAME="Scale" VALUE="ShowAll"><param NAME="DeviceFont" VALUE="0"><param NAME="EmbedMovie" VALUE="0"><param NAME="BGColor" VALUE="FFFFFF"><param NAME="SWRemote" VALUE=""><param NAME="MovieData" VALUE=""><param NAME="SeamlessTabbing" VALUE="1">
<embed src="getURL.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="getURL" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

Offline

#8 2005-10-30 02:52:16

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Xinha corrupts EMBED tags

I think I know what is happening. The browser uses the classid variable in the object to see what parameters it uses. That is why for Flash so many params are added to the code. However, it looks like the browser doesn't know what the params are for that classid.

When I try your example code with the GetHtml plugin or the extended GetHTML, XInha wipes out the param nodes. If I switch classids with the Flash classid, I no longer see a Windows Media player in Xinha, I see an empty Flash movie. The GetHtml plugin generates this code:

    <object id="MediaPlayer" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" type="application/x-oleobject" height="300" standby="Loading Microsoft Windows Media Player components..." width="320" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000">
      <param name="_cx" value="8467" />
      <param name="_cy" value="7938" />
      <param name="FlashVars" VALUE="" />
      <param name="Movie" VALUE="" />
      <param name="Src" VALUE="" />
      <param name="WMode" value="Window" />
      <param name="Play" value="-1" />
      <param name="Loop" value="-1" />
      <param name="Quality" value="High" />
      <param name="SAlign" VALUE="" />
      <param name="Menu" value="-1" />
      <param name="Base" VALUE="" />
      <param name="AllowScriptAccess" value="always" />
      <param name="Scale" value="ShowAll" />
      <param name="DeviceFont" value="0" />
      <param name="EmbedMovie" value="0" />
      <param name="BGColor" VALUE="" />
      <param name="SWRemote" VALUE="" />
      <param name="MovieData" VALUE="" />
      <param name="SeamlessTabbing" value="1" />
      <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" filename="uploads/movies/overtake_catchup.wmv" src="uploads/movies/overtake_catchup.wmv"Name="MediaPlayerShowControls=1" showdisplay="0ShowStatusBar=0width=320height=240" /></embed>
    </object>

and the extended GetHTML generates this code:

<object id=MediaPlayer codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112 type=application/x-oleobject height=300 standby="Loading Microsoft Windows Media Player components..." width=320 classid=clsid:d27cdb6e-ae6d-11cf-96b8-444553540000><param NAME="_cx" VALUE="8467"><param NAME="_cy" VALUE="7938"><param NAME="FlashVars" VALUE=""><param NAME="Movie" VALUE=""><param NAME="Src" VALUE=""><param NAME="WMode" VALUE="Window"><param NAME="Play" VALUE="-1"><param NAME="Loop" VALUE="-1"><param NAME="Quality" VALUE="High"><param NAME="SAlign" VALUE=""><param NAME="Menu" VALUE="-1"><param NAME="Base" VALUE=""><param NAME="AllowScriptAccess" VALUE="always"><param NAME="Scale" VALUE="ShowAll"><param NAME="DeviceFont" VALUE="0"><param NAME="EmbedMovie" VALUE="0"><param NAME="BGColor" VALUE=""><param NAME="SWRemote" VALUE=""><param NAME="MovieData" VALUE=""><param NAME="SeamlessTabbing" VALUE="1">
<embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"
filename="uploads/movies/overtake_catchup.wmv"
src="uploads/movies/overtake_catchup.wmv"Name=MediaPlayerShowControls=1
ShowDisplay=0ShowStatusBar=0width=320height=240></embed></object>

Offline

#9 2005-10-30 03:07:23

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Xinha corrupts EMBED tags

I got it to work with both solutions! You are using an older classid, use the newer CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6 instead, then everything works perfectly! I would suggest that you put quotes around the attribute values in your embed tag, though.

http://www.webaim.org/techniques/captions/windows/3

Using the newr classid for Windows Media Player creates this code with the GetHtml plugin:

    <object id="MediaPlayer" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112" type="application/x-oleobject" height="300" standby="Loading Microsoft Windows Media Player components..." width="320" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6">
      <param name="URL" VALUE="" />
      <param name="rate" value="1" />
      <param name="balance" value="0" />
      <param name="currentPosition" value="0" />
      <param name="defaultFrame" VALUE="" />
      <param name="playCount" value="1" />
      <param name="autoStart" value="-1" />
      <param name="currentMarker" value="0" />
      <param name="invokeURLs" value="-1" />
      <param name="baseURL" VALUE="" />
      <param name="volume" value="50" />
      <param name="mute" value="0" />
      <param name="uiMode" value="full" />
      <param name="stretchToFit" value="0" />
      <param name="windowlessVideo" value="0" />
      <param name="enabled" value="-1" />
      <param name="enableContextMenu" value="-1" />
      <param name="fullScreen" value="0" />
      <param name="SAMIStyle" VALUE="" />
      <param name="SAMILang" VALUE="" />
      <param name="SAMIFilename" VALUE="" />
      <param name="captioningID" VALUE="" />
      <param name="enableErrorDialogs" value="0" />
      <param name="_cx" value="8467" />
      <param name="_cy" value="7938" />
      <embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/windows/windowsmedia/download/" filename="uploads/movies/overtake_catchup.wmv" src="uploads/movies/overtake_catchup.wmv"Name="MediaPlayerShowControls=1" showdisplay="0ShowStatusBar=0width=320height=240" /></embed>
    </object>



...and this code with the extended GetHTML:

<object id=MediaPlayer codeBase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112 type=application/x-oleobject height=300 standby="Loading Microsoft Windows Media Player components..." width=320 classid=CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6><param NAME="URL" VALUE=""><param NAME="rate" VALUE="1"><param NAME="balance" VALUE="0"><param NAME="currentPosition" VALUE="0"><param NAME="defaultFrame" VALUE=""><param NAME="playCount" VALUE="1"><param NAME="autoStart" VALUE="-1"><param NAME="currentMarker" VALUE="0"><param NAME="invokeURLs" VALUE="-1"><param NAME="baseURL" VALUE=""><param NAME="volume" VALUE="50"><param NAME="mute" VALUE="0"><param NAME="uiMode" VALUE="full"><param NAME="stretchToFit" VALUE="0"><param NAME="windowlessVideo" VALUE="0"><param NAME="enabled" VALUE="-1"><param NAME="enableContextMenu" VALUE="-1"><param NAME="fullScreen" VALUE="0"><param NAME="SAMIStyle" VALUE=""><param NAME="SAMILang" VALUE=""><param NAME="SAMIFilename" VALUE=""><param NAME="captioningID" VALUE=""><param NAME="enableErrorDialogs" VALUE="0"><param NAME="_cx" VALUE="8467"><param NAME="_cy" VALUE="7938">
<embed type="application/x-mplayer2"
pluginspage="http://www.microsoft.com/windows/windowsmedia/download/"
filename="uploads/movies/overtake_catchup.wmv"
src="uploads/movies/overtake_catchup.wmv"Name=MediaPlayerShowControls=1
ShowDisplay=0ShowStatusBar=0width=320height=240></embed></object>


-Michael Harris

Offline

#10 2005-10-30 03:33:42

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Xinha corrupts EMBED tags

This classid presents the current look for the player, too, instead of the 1998 look.

Offline

#11 2005-10-30 03:46:54

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Xinha corrupts EMBED tags

Here is more information about the new classid

http://www.w3schools.com/media/media_playerref.asp

Offline

#12 2005-10-30 06:07:40

c0
Xinha Community Member
Registered: 2005-09-01
Posts: 25
Website

Re: Xinha corrupts EMBED tags

Thank you all for your help.  I am more into PHP than javascript; it is really great to find people willing to help out.

(1 minor suggestion: there is no information on the GetHtml plugin page how to install it.  If I just add it to the list of plugins in the config, xinha won't launch.  Also, the plugin download location is not mentioned.  When browsing the source, I got the GetHtml.js file from the plugins/GetHtml dir.  Can't get it to work though)

Offline

#13 2005-10-30 23:25:51

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Xinha corrupts EMBED tags

The plugins are all included in the one download, there is not really any place to download specific plugins, unless you browse source. It is much easier to just get the download, all the plugins are already included.

Offline

Board footer

Powered by FluxBB