[Seaside] Embedding MIDI

Jay Hardesty jayh at panix.com
Sat Oct 29 00:24:49 UTC 2005


Dmitry, Jason -
Thanks very much for the pointers.  The suggested solution is similar 
to what
I had tried previously:

renderContentOn: html
	| url rwBinaryOrTextStream |

	rwBinaryOrTextStream _ self remix midiStream.
	url _ html context
		urlForDocument: rwBinaryOrTextStream
		mimeType: 'audio/midi'
		fileName: self remix name, '.mid'.
	html
		attributeAt: 'src' put: html registry baseUrl asString, url;
		attributeAt: 'width' put: 150;
		attributeAt: 'height' put: 250;
		attributeAt: 'controls' put: true;
		attributeAt: 'autostart' put: true;
		attributeAt: 'loop' put: true;
		tag: 'embed']

But this causes a midi file to be downloaded, and then popped
up in a Quicktime player (I'm on a mac).  If I simply supply the name
of a file, instead of url, as in:

renderContentOn: html

	html
		attributeAt: 'src' put: 'some.mid';
		attributeAt: 'width' put: 150;
		attributeAt: 'height' put: 250;
		attributeAt: 'controls' put: true;
		attributeAt: 'autostart' put: true;
		attributeAt: 'loop' put: true;
		tag: 'embed']

I see the embedded player show up on the page, but I get
an error that the file cannot be found.  Even if I specify the
entire (disk-based) path to the file, the file cannot be found.
I'm sure I'm missing a fundamental disconnect between the
disk-based directory structure, and whatever directory structure
Seaside is using.   I've been looking through the tutorials and
examples, but somewhere or other I missed the basic
mechanism whereby a disk-based file can be accessed
in Seaside.

I'm trying to use Seaside as an intro to web programming in
general, but I'm obviously missing some beginner stuff here.
Sorry if this seems hopelessly naive - but any advice is
certainly appreciated.

Thanks again,
Jay





On Oct 28, 2005, at 7:43 AM, Jason Rogers wrote:

> On 10/28/05, Dmitry Dorofeev <dima-sender-3c337a at yasp.com> wrote:
>> Hi,
>>
>> html attributeAt: 'src' put: 'some.mid'.
>> html attributeAt: 'height' put: 60.
>> html attributeAt: 'width' put: 144.
>> html tag: 'embed'.
>
> Dmitry is correct, but given that you say you are new to Seaside and
> webapps, I wanted to add just a little bit to this.
>
> The code he gave you goes in the #renderContentOn: method of your
> component.  Typically people name the argument that comes into the
> method 'html'.
>
> You should really read some of the wonderful tutorials that have been
> written about Seaside.
>
> --
> Jason Rogers
>
> "I am crucified with Christ: nevertheless I live; yet not I,
> but Christ liveth in me: and the life which I now live in
> the flesh I live by the faith of the Son of God, who loved
> me, and gave himself for me."
>     Galatians 2:20
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside



More information about the Seaside mailing list