Flash problem on eZ 3.1

Author Message

Adri Rots

Thursday 03 July 2003 1:03:28 am

There is a lot written on how to implement Flash. I must be missing something :-)
I still can't display Flash.

- I created a media class named Flash with the fields: name, caption and flash. (number 25)

- I added content read rights in the roles for the anomynous user.

- In design/my design/override/templates/content/view I copied the embed.tpl from the standard directorie.

- In design/my design/override/templates I copied ezmedia.tpl from the standard directorie and renamed it to embed_media.tpl

- In design/my design/override/templates I added a template flash.tpl which looks like:
{* Flash template *}
{default content_version=$node.contentobject_version_object}
{attribute_view_gui attribute=$content_version.data_map.flashfile}
{attribute_view_gui attribute=$content_version.data_map.caption}
{/default}

- In settings/siteaccess/my site/override.ini.append I added:
[flash]
Source=node/view/full.tpl
MatchFile=flash.tpl
Subdir=templates
Match[class]=25

[embed_media]
Source=content/view/embed.tpl
MatchFile=embed_media.tpl
Subdir=templates
Match[class]=25

I uploaded the flash with the created flash class in a folder. In an article I inserted that file as a related object within a xml text field.

After displaying that article in the user site (my design), the text is visable, the flash isn't.

I checked the filerights, disabled cahing, cleared (deleted) the cachefiles.

It's quite a story. What did I do wrong?

Wenyue Yu

Thursday 03 July 2003 5:04:45 am

Hi,

I think the most important point is that you have to create your own embed_media.tpl, copied ezmedia.tpl will not work.

You can use the following file as the embed_media.tpl and try again. (it is only for flash, maybe called embed_flash.tpl):

{let flashfile=$object.data_map.flash.content}
<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="{$flashfile.width}" height="{$flashfile.height}">
<param name="movie" value={concat("content/download/",$object.id,"/",$flashfile.contentobject_attribute_id,"/",$flashfile.original_filename)|ezurl} />
<param name="quality" value="{$flashfile.quality}" />
<param name="play" value="{section show=$flashfile.is_autoplay}true{/section}" />
<param name="loop" value="{section show=$flashfile.is_loop}true{/section}" />
<embed src={concat("content/download/",$object.id,"/",$flashfile.contentobject_attribute_id,"/",$flashfile.original_filename)|ezurl}
quality="{$flashfile.quality}" pluginspage="{$flashfile.pluginspage}"
width="{$flashfile.width}" height="{$flashfile.height}" play="{section show=$flashfile.is_autoplay}true{/section}"
loop="{section show=$flashfile.is_loop}true{/section}" >
</embed>
</object>
{/let}

Here I supposed that your Flash class field which is media datatype is called "flash", otherwise, change line:
{let flashfile=$object.data_map.flash.content}
to
{let flashfile=$object.data_map.Name_you_used.content}

Hope it helps.

Regards,
wenyue

Adri Rots

Thursday 03 July 2003 6:03:42 am

Thanks wenyue for you're quick response.
I changed the embed_media as you described.
Displaying the article in which the flash file is related, the article resizes now for the amount of space I assigned to the flashfile. But the flashfile doesn't appear. The browser (explorer) loads the page very slow and stucks at 39 procent.
I've tried different flash files which works fine in a standard html page.

In the rewrite rules I added the swf extension.
I checked the files in the storage directorie which is the same for that specific site and the admin part of that site.

Does this ring a bell?

Adri

laurent le cadet

Thursday 03 July 2003 6:09:19 am

Hi Wenyue.

Having the same "problem" I tryed your template and it display this :

<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="" height="">
<param name="movie" value="/index.php/content/download/541//" />
<param name="quality" value="" />
<param name="play" value="true" />
<param name="loop" value="true" />
<embed src="/index.php/content/download/541//"
quality="" pluginspage=""
width="" height="" play="true"
loop="true" >
</embed>
</object>

The template recognize that is a flash file but I have no parameter for it and the path seems to be broken.

Any idea about this ?

Wenyue Yu

Thursday 03 July 2003 6:39:48 am

Hi,

Try the following without {let} block:
<object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="{$object.data_map.flash.content.width}" height="{$object.data_map.flash.content.height}">
<param name="movie" value={concat("content/download/",$object.id,"/",$object.data_map.flash.content.contentobject_attribute_id,"/",$object.data_map.flash.content.original_filename)|ezurl} />
<param name="quality" value="{$object.data_map.flash.content.quality}" />
<param name="play" value="{section show=$object.data_map.flash.content.is_autoplay}true{/section}" />
<param name="loop" value="{section show=$object.data_map.flash.content.is_loop}true{/section}" />
<embed src={concat("content/download/",$object.id,"/",$object.data_map.flash.content.contentobject_attribute_id,"/",$object.data_map.flash.content.original_filename)|ezurl}
quality="{$object.data_map.flash.content.quality}" pluginspage="{$object.data_map.flash.content.pluginspage}"
width="{$object.data_map.flash.content.width}" height="{$object.data_map.flash.content.height}" play="{section show=$object.data_map.flash.content.is_autoplay}true{/section}"
loop="{section show=$object.data_map.flash.content.is_loop}true{/section}" >
</embed>
</object>

laurent,
You can use
{$object.data_map|attribute(show)} to find parameters you can get.
and then test with
{$object.data_map.name_of_mediadatatype_in_flash_class.content.width}

Adri Rots

Thursday 03 July 2003 7:30:48 am

Hi wenyue,

I tried it without {let} block. The result is the same. The page still loads very slow and the flahfile will not diplay.

Adri

laurent le cadet

Thursday 03 July 2003 7:47:51 am

With the first line :
{$object.data_map|attribute(show)}

(sorry it's a little bit long)

Attribute Type Value
name object[ezcontentobjectattribute] Object
>id string 1642
>contentobject_id string 541
>version string 2
>language_code string 'eng-GB'
>contentclassattribute_id string 152
>data_text string 'Carte du Pays du Léon'
>data_int string 0
>data_float string 0
>contentclass_attribute object[ezcontentclassattribute] Object
>contentclass_attribute_identifier string 'name'
>content string 'Carte du Pays du Léon'
>object object[ezcontentobject] Object
>view_template string 'ezstring'
>edit_template string 'ezstring'
>validation_error NULL
>validation_log NULL
>language object[ezcontentobjectattribute] Object
>is_a string 'ezstring'
description object[ezcontentobjectattribute] Object
>id string 1643
>contentobject_id string 541
>version string 2
>language_code string 'eng-GB'
>contentclassattribute_id string 157
>data_text string ' Visitez le Léon '
>data_int string 1045487555
>data_float string 0
>contentclass_attribute object[ezcontentclassattribute] Object
>contentclass_attribute_identifier string 'description'
>content object[ezxmltext] Object
>object object[ezcontentobject] Object
>view_template string 'ezxmltext'
>edit_template string 'ezxmltext_ezdhtml'
>validation_error NULL
>validation_log NULL
>language object[ezcontentobjectattribute] Object
>is_a string 'ezxmltext'
swf object[ezcontentobjectattribute] Object
>id string 1644
>contentobject_id string 541
>version string 2
>language_code string 'eng-GB'
>contentclassattribute_id string 154
>data_text string ''
>data_int string 0
>data_float string 0
>contentclass_attribute object[ezcontentclassattribute] Object
>contentclass_attribute_identifier string 'swf'
>content object[ezmedia] Object
>object object[ezcontentobject] Object
>view_template string 'ezmedia'
>edit_template string 'ezmedia'
>validation_error NULL
>validation_log NULL
>language object[ezcontentobjectattribute] Object
>is_a string 'ezmedia'
and a link show by the template line.tpl

And with {$object.data_map.name_of_mediadatatype_in_flash_class.content.width}

Only a link with line.tpl

I'm loose !

Wenyue Yu

Thursday 03 July 2003 7:51:41 am

Hi Adri,

Did you get desired result when you view the flash object in admin preview? ( without embed it in other article).

What result did you get when you use {$object.data_map|attribute(show)}
in embed_media.tpl. ( remove all other lines first to avaid load problem).

Regards,
wenyue

Wenyue Yu

Thursday 03 July 2003 7:59:13 am

Hi laurent,

Did you tried with
{$object.data_map.swf.content.width}?

If you can get some number, then just replace
{let flashfile=$object.data_map.flash.content}
with
{let flashfile=$object.data_map.swf.content}

Regards,
wenyue

laurent le cadet

Thursday 03 July 2003 8:08:22 am

Great ! it works !
I have the file.
I have to go out now for a date but I'll try tomorrow to understand exactly what happend.

Thanks for spending time with us.

See you.

Laurent.

Adri Rots

Thursday 03 July 2003 8:15:48 am

Hi wenyue,

Viewing the flashfile in the admin gives the same result. You can see the dimensions but the flashfile doesn't display. Also the browser (explorer) stucks halfway.

When I use {$object.data_map|attribute(show)} in embed_media.tpl this is the result:

naam object[ezcontentobjectattribute] Object
>id string 640
>contentobject_id string 254
>version string 2
>language_code string 'dut-NL'
>contentclassattribute_id string 193
>data_text string 'OSVO'
>data_int string 0
>data_float string 0
>contentclass_attribute object[ezcontentclassattribute] Object
>contentclass_attribute_identifier string 'naam'
>content string 'OSVO'
>object object[ezcontentobject] Object
>view_template string 'ezstring'
>edit_template string 'ezstring'
>validation_error NULL
>validation_log NULL
>language object[ezcontentobjectattribute] Object
>is_a string 'ezstring'
beschrijving object[ezcontentobjectattribute] Object
>id string 641
>contentobject_id string 254
>version string 2
>language_code string 'dut-NL'
>contentclassattribute_id string 194
>data_text string ' OSVO animatie '
>data_int string 1045487555
>data_float string 0
>contentclass_attribute object[ezcontentclassattribute] Object
>contentclass_attribute_identifier string 'beschrijving'
>content object[ezxmltext] Object
>object object[ezcontentobject] Object
>view_template string 'ezxmltext'
>edit_template string 'ezxmltext_ezdhtml'
>validation_error NULL
>validation_log NULL
>language object[ezcontentobjectattribute] Object
>is_a string 'ezxmltext'
flash object[ezcontentobjectattribute] Object
>id string 642
>contentobject_id string 254
>version string 2
>language_code string 'dut-NL'
>contentclassattribute_id string 196
>data_text string ''
>data_int string 0
>data_float string 0
>contentclass_attribute object[ezcontentclassattribute] Object
>contentclass_attribute_identifier string 'flash'
>content object[ezmedia] Object
>object object[ezcontentobject] Object
>view_template string 'ezmedia'
>edit_template string 'ezmedia'
>validation_error NULL
>validation_log NULL
>language object[ezcontentobjectattribute] Object
>is_a string 'ezmedia'

Adri

 

Wenyue Yu

Thursday 03 July 2003 8:23:29 am

Hi Adri,

What result do you get when you use {$object.data_map.flash.content|attribute(show)}
in embed_media.tpl?

Regards,
wenyue

Adri Rots

Thursday 03 July 2003 8:29:32 am

Hi wenyue,

When using {$object.data_map.flash.content|attribute(show)} in the embed_media.tpl, this is the result:

Attribute Type Value
contentobject_attribute_id string 642
version string 2
filename string 'phpJ7lkjk.swf'
original_filename string 'Osvo.swf'
mime_type string 'application/x-shockwave-flash'
width string 400
height string 300
has_controller string 0
controls string ''
is_autoplay string 1
pluginspage string 'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash'
quality string 'high'
is_loop string 0

Adri

Wenyue Yu

Thursday 03 July 2003 8:44:18 am

Hi Adri,

The output is correct. I don't think you should change rewrite rule and adding swf. Could you change it back and restart apache?

Regards,
wenyue

Adri Rots

Thursday 03 July 2003 9:11:22 am

Hi wenyue,

That's it! I'm quite happy here. The related flashfiles displays as they should now.

I added swf to the rewrite rule because I also use a standard menuflash in the pagelayout. Somehow that didn't display without changing the rewrite rule.

Now after removing the swf extension from the rewriterule the menuflash in the pagelayout still displays although it seems to reload completely now in every new page. Can you explain this?
The solution would be to place the menuflash in a frame, but I wouldn't prefer that.

Adri

Adri Rots

Thursday 03 July 2003 11:22:45 am

Hi wenyue,

My conclusion was wrong. Removing the swf extension in the rewriterules stops displaying the flashfile in the pagelayout. I probably was still seeing it because of my proxiserver.

So removing the swf extension will display the related object in a text xml field but will stop displaying a flashfile in the pagelayout.tpl.

I'll start this problem in a new thread.

Adri

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.