Package tv.phantombot.ytplayer
Class WsYTHandler
java.lang.Object
tv.phantombot.ytplayer.WsYTHandler
- All Implemented Interfaces:
WsFrameHandler
- Author:
- gmt2001
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
Gets theWsAuthenticationHandler
assigned to this endpointint
int
void
handleDBQuery
(ChannelHandlerContext ctx, WebSocketFrame frame, String id, String table) void
handleDBUpdate
(ChannelHandlerContext ctx, WebSocketFrame frame, String id, String table, String key, String value) void
handleFrame
(ChannelHandlerContext ctx, WebSocketFrame frame) Handles the WebSocket frame and sends a response back to the client, if necessary Only gets called if theWsAuthenticationHandler
returnedtrue
int
hashCode()
void
pause()
void
register()
Registers thisWsFrameHandler
with theWebSocketFrameHandler
void
sendJSONToAll
(String jsonString) void
setVolume
(int volume)
-
Constructor Details
-
WsYTHandler
-
-
Method Details
-
register
Description copied from interface:WsFrameHandler
Registers thisWsFrameHandler
with theWebSocketFrameHandler
- Specified by:
register
in interfaceWsFrameHandler
- Returns:
-
getAuthHandler
Description copied from interface:WsFrameHandler
Gets theWsAuthenticationHandler
assigned to this endpoint- Specified by:
getAuthHandler
in interfaceWsFrameHandler
- Returns:
- An
WsAuthenticationHandler
-
handleFrame
Description copied from interface:WsFrameHandler
Handles the WebSocket frame and sends a response back to the client, if necessary Only gets called if theWsAuthenticationHandler
returnedtrue
- Specified by:
handleFrame
in interfaceWsFrameHandler
- Parameters:
ctx
- TheChannelHandlerContext
of the sessionframe
- TheWebSocketFrame
to process
-
handleDBQuery
public void handleDBQuery(ChannelHandlerContext ctx, WebSocketFrame frame, String id, String table) throws JSONException - Throws:
JSONException
-
handleDBUpdate
public void handleDBUpdate(ChannelHandlerContext ctx, WebSocketFrame frame, String id, String table, String key, String value) throws JSONException - Throws:
JSONException
-
play
public void play(String youtubeID, String songTitle, String duration, String requester) throws JSONException - Throws:
JSONException
-
pause
- Throws:
JSONException
-
currentId
- Throws:
JSONException
-
setVolume
- Throws:
JSONException
-
getVolume
public int getVolume() -
getPlayerState
public int getPlayerState() -
sendJSONToAll
-
hashCode
public int hashCode() -
equals
-