Squeak Class Documentation category index | class index  
 
MPEGPlayer
  category: MPEG3-Kernel
  superclass: Object
  subclasses:

V1.01 johnmci@smalltalkconsulting.com Nov 8th 2000
A Simple MPEG Player for playing MPEG3 audio or video

| foo |
foo _ MpegPlayer playFile: 'my.mpg'.
foo playStream: 0. "To play both audio and video, stream #0 "

foo playAudioStream: 0 "To play audio stream".
foo playVideoStream: 0 "To play video stream"
foo playStreamWaitTilDone: 0 "To play audio/video as currrent process"

or
| foo |
foo _ MPEGPlayer playFile: 'my.mpg' onForm: Display.
foo playStream: 0.
To play full screen.

instance methods
  access
  audioPlayerProcess
audioPlayerProcess:
clockBias
clockBias:
clockBiasForStream:
clockBiasForStream:put:
currentAudioSampleForStream:
currentAudioSampleForStream:put:
currentVideoFrameForStream:
currentVideoFrameForStream:put:
errorForSoundStart:
external
fileName
form
form:
frameRate
frameRate:
lastDelay
lastDelay:
morph
morph:
mpegFile
noSound
noSound:
playerProcessPriority
playerProcessPriority:
sampleRate
sampleRate:
soundQueue
soundQueue:
startTime
startTime:
startTimeForStream:
startTimeForStream:put:
timeCheck
timeCheck:
videoPlayerProcess
videoPlayerProcess:
volume:

  access to attributes
  audioChannels:
audioSampleRate:
audioSamples:
currentExternalLocationInPercent
currentLocationInPercent:
endOfAudio:
endOfVideo:
getTOC:doStreams:
getTimeCode
hasAudio
hasVideo
setMMX:
totalVideoStreams
videoDropFrames:stream:
videoFrameHeight:
videoFrameRate:
videoFrameWidth:
videoFrames:
videoPreviousFrame:
videoSetCPUs:

  audio
  createSoundFrom:
privatePlayAudioStream:
readSoundChannel:stream:
setupStream:
setupStreamNoSeek:
startAudioPlayerProcess:
updateSoundStream:

  delay
  calculateDelayGivenFrame:stream:
calculateDelayToSoundGivenFrame:stream:
decideToSkipAFrame:averageWait:stream:

  initialize-release
  close
initialize:
initializeWithFileName:
initializeWithFileName:form:
initializeWithFileName:morph:
stopAndClose

  play
  playAudioStream:
playAudioStreamNoSeek:
playAudioStreamWaitTilDone:
playStream:
playStreamWaitTilDone:
playVideoStream:
playVideoStreamWaitTilDone:

  play controls
  backAudio:forStream:
backVideo:forStream:
forwardAudio:forStream:
forwardVideo:forStream:
isPlaying
recalculateNewSampleLocationForStream:givenFrame:
seekToHere:forStream:
seekVideoAudioBasedOnFrame:forStream:
setLocation:forStream:
stop

  utility
  changed
checkForm:

  video
  privatePlayVideoStream:
startVideoPlayerProcess:
videoLoop:

class methods
  instance creation
  playFile:
playFile:onForm:
playFile:onMorph:

instance methods
  access top  
 

audioPlayerProcess


 

audioPlayerProcess:


 

clockBias


 

clockBias:


 

clockBiasForStream:


 

clockBiasForStream:put:


 

currentAudioSampleForStream:


 

currentAudioSampleForStream:put:


 

currentVideoFrameForStream:


 

currentVideoFrameForStream:put:


 

errorForSoundStart:


 

external


 

fileName


 

form


 

form:


 

frameRate


 

frameRate:


 

lastDelay


 

lastDelay:


 

morph


 

morph:


 

mpegFile


 

noSound


 

noSound:


 

playerProcessPriority


 

playerProcessPriority:


 

sampleRate


 

sampleRate:


 

soundQueue


 

soundQueue:


 

startTime


 

startTime:


 

startTimeForStream:


 

startTimeForStream:put:


 

timeCheck


 

timeCheck:


 

videoPlayerProcess


 

videoPlayerProcess:


 

volume:


  access to attributes top  
 

audioChannels:


 

audioSampleRate:


 

audioSamples:


 

currentExternalLocationInPercent

Warning this might not return what you want, it gets percentage based on audio, or video stream based on last usage, because we buffer audio it may give incorrect information when playing mpeg movies


 

currentLocationInPercent:


 

endOfAudio:


 

endOfVideo:


 

getTOC:doStreams:


 

getTimeCode


 

hasAudio


 

hasVideo


 

setMMX:


 

totalVideoStreams


 

videoDropFrames:stream:


 

videoFrameHeight:


 

videoFrameRate:


 

videoFrameWidth:


 

videoFrames:


 

videoPreviousFrame:


 

videoSetCPUs:


  audio top  
 

createSoundFrom:


 

privatePlayAudioStream:


 

readSoundChannel:stream:


 

setupStream:


 

setupStreamNoSeek:


 

startAudioPlayerProcess:


 

updateSoundStream:


  delay top  
 

calculateDelayGivenFrame:stream:


 

calculateDelayToSoundGivenFrame:stream:


 

decideToSkipAFrame:averageWait:stream:


  initialize-release top  
 

close


 

initialize:


 

initializeWithFileName:


 

initializeWithFileName:form:


 

initializeWithFileName:morph:


 

stopAndClose


  play top  
 

playAudioStream:


 

playAudioStreamNoSeek:


 

playAudioStreamWaitTilDone:


 

playStream:


 

playStreamWaitTilDone:


 

playVideoStream:


 

playVideoStreamWaitTilDone:


  play controls top  
 

backAudio:forStream:


 

backVideo:forStream:


 

forwardAudio:forStream:


 

forwardVideo:forStream:


 

isPlaying


 

recalculateNewSampleLocationForStream:givenFrame:


 

seekToHere:forStream:

Alternate method is to seek all video/audio for stream to a certain percentage using the primitive, but I think your mpeg must have timecodes! otherwise endless loop


 

seekVideoAudioBasedOnFrame:forStream:


 

setLocation:forStream:


 

stop


  utility top  
 

changed

Receiver changed in a general way; inform all the dependents by
sending each dependent an update: message.


 

checkForm:


  video top  
 

privatePlayVideoStream:


 

startVideoPlayerProcess:


 

videoLoop:


class methods
  instance creation top  
 

playFile:


 

playFile:onForm:


 

playFile:onMorph: