Karl Ramberg uploaded a new version of Movies to project Etoys:
http://source.squeak.org/etoys/Movies-kfr.2.mcz==================== Summary ====================
Name: Movies-kfr.2
Author: kfr
Time: 20 May 2011, 9:30:31 pm
UUID: 63c9530b-1468-6543-9dc4-41875e662331
Ancestors: Movies-bf.1
Fix file dialog if movie file is missing in movie player
=============== Diff against Movies-bf.1 ===============
Item was changed:
----- Method: MPEGDisplayMorph>>startPlaying (in category 'commands') -----
startPlaying
"Start playing the movie at the current position."
| frameIndex |
self stopPlaying.
stopFrame _ nil.
self mpegFileIsOpen ifFalse: [^ self].
+ (FileStream isAFileNamed: mpegFile fileName) ifFalse: [
- (FileStream isAFileNamed: mpegFile fileName) ifFalse: [ | newFileResult newFileName |
self inform: 'Path changed. Enter new one for: ' translated, (FileDirectory localNameFor: mpegFile fileName).
+ self openMPEGFile.
+ (self openFileNamed: (mpegFile fileName)) ifFalse:[ ^self inform:'No valid file selected' translated]
+ ].
- newFileResult _ StandardFileMenu oldFile.
- newFileName _ newFileResult directory fullNameFor: newFileResult name.
- mpegFile openFile: newFileName].
mpegFile hasAudio
ifTrue:
[mpegFile hasVideo ifTrue:
["set movie frame position from soundTrack position"
soundTrack reset. "ensure file is open before positioning"
soundTrack soundPosition: (mpegFile videoGetFrame: 0) asFloat / (mpegFile videoFrames: 0).
"now set frame index from the soundtrack position for best sync"
frameIndex _ ((soundTrack millisecondsSinceStart * desiredFrameRate) // 1000).
frameIndex _ (frameIndex max: 0) min: ((mpegFile videoFrames: 0) - 3).
mpegFile videoSetFrame: frameIndex stream: 0].
SoundPlayer stopReverb.
soundTrack volume: volume.
soundTrack repeat: repeat.
soundTrack resumePlaying.
startFrame _ startMSecs _ 0]
ifFalse:
[soundTrack _ nil.
startFrame _ mpegFile videoGetFrame: 0.
startMSecs _ Time millisecondClockValue].
+ running _ true!
- running _ true!
_______________________________________________
etoys-dev mailing list
[hidden email]
http://lists.squeakland.org/mailman/listinfo/etoys-dev