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 TypeMethodDescriptionvoidbooleanGets theWsAuthenticationHandlerassigned to this endpointintintvoidhandleDBQuery(ChannelHandlerContext ctx, WebSocketFrame frame, String id, String table) voidhandleDBUpdate(ChannelHandlerContext ctx, WebSocketFrame frame, String id, String table, String key, String value) voidhandleFrame(ChannelHandlerContext ctx, WebSocketFrame frame) Handles the WebSocket frame and sends a response back to the client, if necessary Only gets called if theWsAuthenticationHandlerreturnedtrueinthashCode()voidpause()voidregister()Registers thisWsFrameHandlerwith theWebSocketFrameHandlervoidsendJSONToAll(String jsonString) voidsetVolume(int volume)
-
Constructor Details
-
WsYTHandler
-
-
Method Details
-
register
Description copied from interface:WsFrameHandlerRegisters thisWsFrameHandlerwith theWebSocketFrameHandler- Specified by:
registerin interfaceWsFrameHandler- Returns:
-
getAuthHandler
Description copied from interface:WsFrameHandlerGets theWsAuthenticationHandlerassigned to this endpoint- Specified by:
getAuthHandlerin interfaceWsFrameHandler- Returns:
- An
WsAuthenticationHandler
-
handleFrame
Description copied from interface:WsFrameHandlerHandles the WebSocket frame and sends a response back to the client, if necessary Only gets called if theWsAuthenticationHandlerreturnedtrue- Specified by:
handleFramein interfaceWsFrameHandler- Parameters:
ctx- TheChannelHandlerContextof the sessionframe- TheWebSocketFrameto 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, int index) 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
-