Package com.storedobject.vaadin.util
Class MediaStreamVariable
java.lang.Object
com.storedobject.vaadin.util.MediaStreamVariable
- All Implemented Interfaces:
com.vaadin.flow.server.StreamVariable
,Serializable
The MediaStreamVariable class implements the StreamVariable interface to handle
streaming data with associated MIME type provided by a MediaCapture.DataReceiver.
It manages the output stream for the streaming data and handles streaming events.
- Author:
- Syam
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.flow.server.StreamVariable
com.vaadin.flow.server.StreamVariable.StreamingEndEvent, com.vaadin.flow.server.StreamVariable.StreamingErrorEvent, com.vaadin.flow.server.StreamVariable.StreamingEvent, com.vaadin.flow.server.StreamVariable.StreamingProgressEvent, com.vaadin.flow.server.StreamVariable.StreamingStartEvent
-
Constructor Summary
ConstructorsConstructorDescriptionMediaStreamVariable
(MediaCapture.DataReceiver receiver) Constructs a MediaStreamVariable instance with the specified MediaCapture.DataReceiver. -
Method Summary
Modifier and TypeMethodDescriptiongetMime()
Returns the MIME type associated with the streaming media.boolean
boolean
void
onProgress
(com.vaadin.flow.server.StreamVariable.StreamingProgressEvent event) void
streamingFailed
(com.vaadin.flow.server.StreamVariable.StreamingErrorEvent event) void
streamingFinished
(com.vaadin.flow.server.StreamVariable.StreamingEndEvent event) void
streamingStarted
(com.vaadin.flow.server.StreamVariable.StreamingStartEvent event)
-
Constructor Details
-
MediaStreamVariable
Constructs a MediaStreamVariable instance with the specified MediaCapture.DataReceiver.- Parameters:
receiver
- the MediaCapture.DataReceiver to receive streaming data
-
-
Method Details
-
getOutputStream
- Specified by:
getOutputStream
in interfacecom.vaadin.flow.server.StreamVariable
-
isInterrupted
public boolean isInterrupted()- Specified by:
isInterrupted
in interfacecom.vaadin.flow.server.StreamVariable
-
listenProgress
public boolean listenProgress()- Specified by:
listenProgress
in interfacecom.vaadin.flow.server.StreamVariable
-
onProgress
public void onProgress(com.vaadin.flow.server.StreamVariable.StreamingProgressEvent event) - Specified by:
onProgress
in interfacecom.vaadin.flow.server.StreamVariable
-
streamingFailed
public void streamingFailed(com.vaadin.flow.server.StreamVariable.StreamingErrorEvent event) - Specified by:
streamingFailed
in interfacecom.vaadin.flow.server.StreamVariable
-
streamingFinished
public void streamingFinished(com.vaadin.flow.server.StreamVariable.StreamingEndEvent event) - Specified by:
streamingFinished
in interfacecom.vaadin.flow.server.StreamVariable
-
streamingStarted
public void streamingStarted(com.vaadin.flow.server.StreamVariable.StreamingStartEvent event) - Specified by:
streamingStarted
in interfacecom.vaadin.flow.server.StreamVariable
-
getMime
Returns the MIME type associated with the streaming media.- Returns:
- the MIME type as a String
-