public class LiveDanMuReceiver extends Object implements Closeable
| 构造器和说明 |
|---|
LiveDanMuReceiver(int roomId)
Class constructor, need room id.
|
LiveDanMuReceiver(String url)
Class constructor, need URL of room in String.
|
LiveDanMuReceiver(URL url)
Class constructor, need URL of room.
|
| 限定符和类型 | 方法和说明 |
|---|---|
LiveDanMuReceiver |
addCallback(ILiveDanMuCallback liveDanMuCallback)
Add callback, it will be invoked on data incoming or lost connection.
|
void |
close()
Close the connect and interrupt thread.
|
LiveDanMuReceiver |
connect()
Connect to live server.
|
Optional<Long> |
getRandom()
Get DANMU_RND.
|
int |
getRoomId()
Get ROOMID
|
Optional<Integer> |
getRoomURL()
Get ROOMURL.
|
Optional<URL> |
getUrl()
Get URL of room.
|
boolean |
isConnected()
Get is socket connected.
|
boolean |
removeCallback(ILiveDanMuCallback liveDanMuCallback)
Remove callback.
|
LiveDanMuReceiver |
setPrintDebugInfo(Boolean printDebugInfo)
Set print debug info, default is false.
|
void |
waitUntilCallbackDispatchThreadExit()
Wait until CallbackDispatchThread exit.
|
public LiveDanMuReceiver(int roomId)
roomId - the id of roompublic LiveDanMuReceiver(String url)
url - the URL of room in Stringpublic LiveDanMuReceiver(URL url)
url - the URL of roompublic LiveDanMuReceiver addCallback(ILiveDanMuCallback liveDanMuCallback)
liveDanMuCallback - the class which implements from ILiveDanMuCallbackpublic boolean removeCallback(ILiveDanMuCallback liveDanMuCallback)
liveDanMuCallback - the class which implements from ILiveDanMuCallbackpublic LiveDanMuReceiver connect() throws IOException, IllegalArgumentException
IOException - when socket errorIllegalArgumentException - when room id invalidpublic LiveDanMuReceiver setPrintDebugInfo(Boolean printDebugInfo)
printDebugInfo - true for print, false for notpublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOException - inherit from CloseableCloseablepublic void waitUntilCallbackDispatchThreadExit()
public int getRoomId()
public boolean isConnected()
Copyright © 2017. All rights reserved.