Lights, Camera, Squeak
Alan Kay said the computer is not a tool, but a new medium. In order for users to fully express themselves with a computer, it is important to integrate previous forms of expression into a more-powerful whole.
I have a working proof-of-concept to play any video file that QuickTime can handle in Squeak Smalltalk (or Pharo with slight modifications). This prototype is Mac-only.
If you have Gofer and Metacello installed, you can install the current version in Squeak 4.1 and Pharo 1.1.1 with:
Gofer new
squeaksource: 'MetacelloRepository';
package: 'ConfigurationOfFFI';
load.
((Smalltalk at: #ConfigurationOfFFI) project latestVersion) load.
Gofer new
squeaksource: 'SophieGoldDig';
package: 'SpdQT';
load.
Then, blow your mind by playing a video in-image with:
aURI := URI fromString: 'file:///path/to/video.ext'.
movie := QuickTimeMovie openMovieFromURI: aURI.
m := SqueakMovieMorph openOn: movie.
Usage:
- click on the morph to play/stop the video
Issues:
extra processes may be left running(FIXED)Pharo 1.1.1: this will work after two errors – for both, go into the debugger and remove the isFinalizationSupported checks.(FIXED)
For our lazy/skeptical friends, here is a Flash video (.flv – H.264, 320 x 216, Millions; AAC,
Stereo, 22.050 kHz) playing in Squeak 4.1:
UPDATES:
- fixed bug that left extra processes running when a movie was stopped and then restarted
- package now loads correctly in Pharo 1.1.1
Categories: Smalltalk
Did you try to rotate the morph as it was possible with the old video players in Squeak.
Croquet is able to map it also to 3D …
@Torsten Rotation, check! Cool…
[...] This post was mentioned on Twitter by Sean T Allen. Sean T Allen said: RT @SeanDenigris: New blog post: Lights, Camera, Squeak http://seandenigris.com/blog/?p=723 #Smalltalk #Squeak #Pharo [...]
[...] Sean de Nigris has been doing some great archaeology recently, and with help from some of the original Sophie team, he has managed to get some of Sophie’s rich multimedia capabilities working in mainstream Squeak images. [...]
Great work Sean. I just put a post up on news.squeak.org featuring this great piece of work, and then saw Torsten’s comment – but too late. It would have been even cooler if I’d had that morph tilted on its side for that screenshot!
Hey Michael. The same thing happened to me – right after I made the screencast, I saw Torsten’s comment. I feel like Alan Kay whenever I rotate something in Morphic for no other reason than because-I-can.
Do I need to clean up something after grabbing a frame from a movie? The following halts on iteration 157 (the form returned is all white). Only way I’ve found to fix it is to save and quit the image and restart.
test: info
| count f2 movie t1 uri |
count _ 0.
[
(count _ count + 1) asString,’ ‘ displayAt: 0@20.
t1 _ info first.
uri _ info second.
movie _ QuickTimeMovie openMovieFromURI: uri.
movie privateTime: t1.
f2 _ movie offscreenForm deepCopy.
(f2 colorAt: 0@0) printString = ‘(Color r: 0.121 g: 0.149 b: 0.117)’ ifFalse: [self halt].
] repeat.
I don’t know. I’m getting either an error or vm crash after similar iterations. I never tried to open that many movies at once before…
OK, maybe this fixes it. In QuickTimeMovie:
finalize
gWorldPtr ifNotNil: [gWorldPtr disposeGWorld].
self disposeMovieController.
movie ifNotNil: [self quicktimeInterfaceClassForCurrentPlatform apiDisposeMovie: movie. movie _ nil]