[Android] java.lang.UnsupportedOperationException: This session doesn't support queue management operations

[Android] java.lang.UnsupportedOperationException: This session doesn't support queue management operations

MediaControllerCompat ์žฌ์ƒ๋ชฉ๋ก ์ˆ˜์ •(addQueueItem / removeQueueItem)์„ ์‹œ๋„ํ–ˆ์„ ๋•Œ UnsupportedOperationException ๋ฐœ์ƒํ•˜๋Š” ๊ฒฝ์šฐ..

java.lang.UnsupportedOperationException: This session doesn't support queue management operations

ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

MediaSessionConnector์— QueueEditor๋ฅผ ์„ค์ •ํ•ด์ค€๋‹ค.

queueEditor = TimelineQueueEditor(...)
mediaSessionConnector.setQueueEditor(queueEditor)

MediaSession์˜ ๋™์ž‘์€ ํ”Œ๋ž˜๊ทธ์— ๋”ฐ๋ผ ๊ฐ€๋Šฅํ•œ ๋™์ž‘์ธ์ง€ ์•„๋‹Œ์ง€๋ฅผ ํŒ๋ณ„ํ•œ๋‹ค. ์žฌ์ƒ ๋ชฉ๋ก ์ˆ˜์ •๊ณผ ๊ด€๋ จ๋œ ํ”Œ๋ž˜๊ทธ๋Š” MediaSessionCompat.FLAG_HANDLES_QUEUE_COMMANDS์ด๋‹ค. MediaSessionConnector.setQueueEditor ๋‚ด๋ถ€ ๊ตฌํ˜„์„ ๋ณด๋ฉด queueEditor๊ฐ€ null์ด๋ฉด ํ•ด๋‹น ํ”Œ๋ž˜๊ทธ๊ฐ€ ์—†๋Š” default ํ”Œ๋ž˜๊ทธ๋กœ ์ง€์ •ํ•˜๊ณ , null์ด ์•„๋‹Œ ๊ฒฝ์šฐ ํ•ด๋‹น ํ”Œ๋ž˜๊ทธ๋ฅผ ์ถ”๊ฐ€ํ•œ๋‹ค.

Comments