Top Inners Fields Constructors Methods
com.sun.javafx.webkit.prism

pack-priv final Class WCMediaPlayerImpl

extends WCMediaPlayer
implements PlayerStateListener, MediaErrorListener, VideoTrackSizeListener, BufferListener, PlayerTimeListener
Class Inheritance
All Implemented Interfaces
com.sun.media.jfxmedia.events.PlayerTimeListener, com.sun.media.jfxmedia.events.BufferListener, com.sun.media.jfxmedia.events.VideoTrackSizeListener, com.sun.media.jfxmedia.events.MediaErrorListener, com.sun.media.jfxmedia.events.PlayerStateListener
Imports
java.net.URI, java.util.List, com.sun.javafx.media.PrismMediaFrameHandler, com.sun.media.jfxmedia.Media, .MediaManager, .MediaPlayer, com.sun.media.jfxmedia.control.VideoDataBuffer, com.sun.media.jfxmedia.events.BufferListener, .BufferProgressEvent, .MediaErrorListener, .NewFrameEvent, .PlayerStateEvent, .PlayerStateListener, .PlayerTimeListener, .VideoRendererListener, .VideoTrackSizeListener, com.sun.media.jfxmedia.locator.Locator, com.sun.media.jfxmedia.track.AudioTrack, .Track, .VideoTrack, com.sun.prism.Graphics, .Texture, com.sun.prism.paint.Color, com.sun.webkit.graphics.WCGraphicsContext, .WCMediaPlayer

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private float
private float
private boolean
private volatile WCMediaPlayerImpl.CreateThread
private int
private volatile PrismMediaFrameHandler
private final WCMediaPlayerImpl.MediaFrameListener
private boolean
private final Object
private volatile MediaPlayer
Inherited from com.sun.webkit.graphics.WCMediaPlayer:
logNETWORK_STATE_DECODE_ERRORNETWORK_STATE_EMPTYNETWORK_STATE_FORMAT_ERRORNETWORK_STATE_IDLENETWORK_STATE_LOADEDNETWORK_STATE_LOADINGNETWORK_STATE_NETWORK_ERRORPRELOAD_AUTOPRELOAD_METADATAPRELOAD_NONEREADY_STATE_HAVE_CURRENT_DATAREADY_STATE_HAVE_ENOUGH_DATAREADY_STATE_HAVE_FUTURE_DATAREADY_STATE_HAVE_METADATAREADY_STATE_HAVE_NOTHING

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
protected void
protected void
protected float
private MediaPlayer
private void
protected void
load(String url, String userAgent)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.load.

Methods to implement

private void
public void
onBufferProgress(BufferProgressEvent
CacheStateEvent object.
event
)

Implements com.sun.media.jfxmedia.events.BufferListener.onBufferProgress.

Notification about buffer progress.

public void
onDurationChanged(double
the duration in seconds.
duration
)

Implements com.sun.media.jfxmedia.events.PlayerTimeListener.onDurationChanged.

Invoked when there is an update to the duration estimate.

public void
onError(Object
the source of the warning, likely the object calling this method.
source
,
int
an error code from the internal playback processor
errCode
,
String
a String containing the warning.
message
)

Implements com.sun.media.jfxmedia.events.MediaErrorListener.onError.

Reports the occurrence of a error in media processing.

public void
onFinish(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onFinish.

The finish state indicates playback has completed playback to the end.

public void
onHalt(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onHalt.

The error notification provides information on any error during playback.

public void
onPause(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onPause.

The pause state indicates playback has paused.

public void
onPlaying(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onPlaying.

The play state indicates the media is beginning to play.

public void
onReady(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onReady.

The ready state indicates the media is loaded.

public void
onSizeChanged(int
The new width of the video frames.
width
,
int
The new height of the video frames.
height
)

Implements com.sun.media.jfxmedia.events.VideoTrackSizeListener.onSizeChanged.

The size notification indicates the dimension of the video has changed.

public void
public void
onStop(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onStop.

The stop state indicates playback has paused and presentation time has been reset back to 0.

protected void
protected void
protected void
private void
protected void
private void
renderImpl(WCGraphicsContext gc, int x, int y, int w, int h)

protected void
seek(float time)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.seek.

protected void
setMute(boolean mute)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.setMute.

private void
protected void
protected void
protected void
setSize(int w, int h)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.setSize.

protected void
private void
Inherited from com.sun.webkit.graphics.WCMediaPlayer:
getNetworkStategetPreloadgetPreservesPitchgetReadyStateisPausedisSeekingnotifyBufferChangednotifyDurationChangednotifyFinishednotifyNetworkStateChangednotifyNewFramenotifyPausednotifyReadynotifyReadyStateChangednotifySeekingnotifySizeChanged

Field Detail

bufferedEndback to summary
private float bufferedEnd
bufferedStartback to summary
private float bufferedStart
bufferingback to summary
private boolean buffering
createThreadback to summary
private volatile WCMediaPlayerImpl.CreateThread createThread
finishedback to summary
private int finished
frameHandlerback to summary
private volatile PrismMediaFrameHandler frameHandler
frameListenerback to summary
private final WCMediaPlayerImpl.MediaFrameListener frameListener
gotFirstFrameback to summary
private boolean gotFirstFrame
lockback to summary
private final Object lock
playerback to summary
private volatile MediaPlayer player

Constructor Detail

WCMediaPlayerImplback to summary
pack-priv WCMediaPlayerImpl()

Method Detail

cancelLoadback to summary
protected void cancelLoad()

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.cancelLoad.

Annotations
@Override
disposePlayerback to summary
protected void disposePlayer()

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.disposePlayer.

Annotations
@Override
getCurrentTimeback to summary
protected float getCurrentTime()

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.getCurrentTime.

Annotations
@Override
getPlayerback to summary
private MediaPlayer getPlayer()
installListenersback to summary
private void installListeners()
loadback to summary
protected void load(String url, String userAgent)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.load.

Doc from com.sun.webkit.graphics.WCMediaPlayer.load.

Methods to implement

Annotations
@Override
notifyFrameArrivedback to summary
private void notifyFrameArrived()
onBufferProgressback to summary
public void onBufferProgress(BufferProgressEvent event)

Implements com.sun.media.jfxmedia.events.BufferListener.onBufferProgress.

Doc from com.sun.media.jfxmedia.events.BufferListener.onBufferProgress.

Notification about buffer progress.

Parameters
event:BufferProgressEvent

CacheStateEvent object.

Annotations
@Override
onDurationChangedback to summary
public void onDurationChanged(double duration)

Implements com.sun.media.jfxmedia.events.PlayerTimeListener.onDurationChanged.

Doc from com.sun.media.jfxmedia.events.PlayerTimeListener.onDurationChanged.

Invoked when there is an update to the duration estimate.

Parameters
duration:double

the duration in seconds.

Annotations
@Override
onErrorback to summary
public void onError(Object source, int errCode, String message)

Implements com.sun.media.jfxmedia.events.MediaErrorListener.onError.

Doc from com.sun.media.jfxmedia.events.MediaErrorListener.onError.

Reports the occurrence of a error in media processing. An error may or may not cause a stop in processing.

Parameters
source:Object

the source of the warning, likely the object calling this method.

errCode:int

an error code from the internal playback processor

message:String

a String containing the warning.

Annotations
@Override
onFinishback to summary
public void onFinish(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onFinish.

Doc from com.sun.media.jfxmedia.events.PlayerStateListener.onFinish.

The finish state indicates playback has completed playback to the end.

Annotations
@Override
onHaltback to summary
public void onHalt(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onHalt.

Doc from com.sun.media.jfxmedia.events.PlayerStateListener.onHalt.

The error notification provides information on any error during playback.

Annotations
@Override
onPauseback to summary
public void onPause(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onPause.

Doc from com.sun.media.jfxmedia.events.PlayerStateListener.onPause.

The pause state indicates playback has paused.

Annotations
@Override
onPlayingback to summary
public void onPlaying(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onPlaying.

Doc from com.sun.media.jfxmedia.events.PlayerStateListener.onPlaying.

The play state indicates the media is beginning to play.

Annotations
@Override
onReadyback to summary
public void onReady(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onReady.

Doc from com.sun.media.jfxmedia.events.PlayerStateListener.onReady.

The ready state indicates the media is loaded. For best results, developers should wait on OnReady() before playing a media.

Annotations
@Override
onSizeChangedback to summary
public void onSizeChanged(int width, int height)

Implements com.sun.media.jfxmedia.events.VideoTrackSizeListener.onSizeChanged.

Doc from com.sun.media.jfxmedia.events.VideoTrackSizeListener.onSizeChanged.

The size notification indicates the dimension of the video has changed.

Parameters
width:int

The new width of the video frames.

height:int

The new height of the video frames.

Annotations
@Override
onStallback to summary
public void onStall(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onStall.

Annotations
@Override
onStopback to summary
public void onStop(PlayerStateEvent pse)

Implements com.sun.media.jfxmedia.events.PlayerStateListener.onStop.

Doc from com.sun.media.jfxmedia.events.PlayerStateListener.onStop.

The stop state indicates playback has paused and presentation time has been reset back to 0. If the player is asked to play() again, playback begins from the beginning.

Annotations
@Override
pauseback to summary
protected void pause()

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.pause.

Annotations
@Override
playback to summary
protected void play()

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.play.

Annotations
@Override
prepareToPlayback to summary
protected void prepareToPlay()

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.prepareToPlay.

Annotations
@Override
removeListenersback to summary
private void removeListeners()
renderCurrentFrameback to summary
protected void renderCurrentFrame(WCGraphicsContext gc, int x, int y, int w, int h)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.renderCurrentFrame.

Annotations
@Override
renderImplback to summary
private void renderImpl(WCGraphicsContext gc, int x, int y, int w, int h)
seekback to summary
protected void seek(float time)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.seek.

Annotations
@Override
setMuteback to summary
protected void setMute(boolean mute)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.setMute.

Annotations
@Override
setPlayerback to summary
private void setPlayer(MediaPlayer p)
setPreservesPitchback to summary
protected void setPreservesPitch(boolean preserve)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.setPreservesPitch.

Annotations
@Override
setRateback to summary
protected void setRate(float rate)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.setRate.

Annotations
@Override
setSizeback to summary
protected void setSize(int w, int h)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.setSize.

Annotations
@Override
setVolumeback to summary
protected void setVolume(float volume)

Implements abstract com.sun.webkit.graphics.WCMediaPlayer.setVolume.

Annotations
@Override
updateBufferingStatusback to summary
private void updateBufferingStatus()
com.sun.javafx.webkit.prism back to summary

private final Class WCMediaPlayerImpl.CreateThread

extends Thread
Class Inheritance

Field Summary

Modifier and TypeField and Description
private boolean
private final String
private final String
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
private
CreateThread(String url, String userAgent)

Method Summary

Modifier and TypeMethod and Description
private void
public void
run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

This method is run by the thread when it executes.

Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopthreadIdtoStringyield

Field Detail

cancelledback to summary
private boolean cancelled
urlback to summary
private final String url
userAgentback to summary
private final String userAgent

Constructor Detail

CreateThreadback to summary
private CreateThread(String url, String userAgent)

Method Detail

cancelback to summary
private void cancel()
runback to summary
public void run()

Overrides java.lang.Thread.run.

Implements java.lang.Runnable.run.

Doc from java.lang.Thread.run.

This method is run by the thread when it executes. Subclasses of Thread may override this method.

This method is not intended to be invoked directly. If this thread is a platform thread created with a Runnable task then invoking this method will invoke the task's run method. If this thread is a virtual thread then invoking this method directly does nothing.

Annotations
@Override
com.sun.javafx.webkit.prism back to summary

private final Class WCMediaPlayerImpl.MediaFrameListener

extends Object
implements VideoRendererListener
Class Inheritance
  • java.lang.Object
  • com.sun.javafx.webkit.prism.WCMediaPlayerImpl.MediaFrameListener
All Implemented Interfaces
com.sun.media.jfxmedia.events.VideoRendererListener

Field Summary

Modifier and TypeField and Description
private VideoDataBuffer
private final Object
private VideoDataBuffer

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public VideoDataBuffer
public void
releaseVideoFrames()

Implements com.sun.media.jfxmedia.events.VideoRendererListener.releaseVideoFrames.

Notifies the listener that it needs to release video frames.

public void
videoFrameUpdated(NewFrameEvent
The event.
nfe
)

Implements com.sun.media.jfxmedia.events.VideoRendererListener.videoFrameUpdated.

Notifies the listener that a new frame is available for rendering.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentFrameback to summary
private VideoDataBuffer currentFrame
frameLockback to summary
private final Object frameLock
nextFrameback to summary
private VideoDataBuffer nextFrame

Constructor Detail

MediaFrameListenerback to summary
private MediaFrameListener()

Method Detail

getLatestFrameback to summary
public VideoDataBuffer getLatestFrame()
releaseVideoFramesback to summary
public void releaseVideoFrames()

Implements com.sun.media.jfxmedia.events.VideoRendererListener.releaseVideoFrames.

Doc from com.sun.media.jfxmedia.events.VideoRendererListener.releaseVideoFrames.

Notifies the listener that it needs to release video frames.

Annotations
@Override
videoFrameUpdatedback to summary
public void videoFrameUpdated(NewFrameEvent nfe)

Implements com.sun.media.jfxmedia.events.VideoRendererListener.videoFrameUpdated.

Doc from com.sun.media.jfxmedia.events.VideoRendererListener.videoFrameUpdated.

Notifies the listener that a new frame is available for rendering.

Parameters
nfe:NewFrameEvent

The event.

Annotations
@Override