Lines Matching refs:item

33  * Actual playback of a single media item is abstracted into a Player interface,
88 // If player supports queuing, get status of each item. Player is
92 PlaylistItem item = mPlaylist.get(i);
93 mPlayer.getStatus(item, (i == mPlaylist.size() - 1) /* update */);
96 // Otherwise, only need to get status for current item. Player is
114 // append new item with initial status PLAYBACK_STATE_PENDING
115 PlaylistItem item = new PlaylistItem(Integer.toString(mSessionId),
117 mPlaylist.add(item);
120 // if player supports queuing, enqueue the item now
122 mPlayer.enqueue(item);
125 return item;
144 PlaylistItem item = getCurrentItem();
145 if (pos != item.getPosition()) {
146 item.setPosition(pos);
147 if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PLAYING
148 || item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED) {
149 mPlayer.seek(item);
152 return item;
165 for (PlaylistItem item : mPlaylist) {
166 if (item.getItemId().equals(iid)) {
167 if (item == getCurrentItem()) {
168 mPlayer.getStatus(item, false);
170 return item;
243 // Suspend the playback manager. Put the current item back into PENDING
247 for (PlaylistItem item : mPlaylist) {
248 item.setRemoteItemId(null);
249 item.setDuration(0);
251 PlaylistItem item = getCurrentItem();
253 log("suspend: item=" + item + ", pos=" + pos);
255 if (item != null) {
256 if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PLAYING
257 || item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED) {
258 item.setState(MediaItemStatus.PLAYBACK_STATE_PENDING);
259 item.setPosition(pos);
265 // This will resume playback of current item. Furthermore, if the new player
272 for (PlaylistItem item : mPlaylist) {
273 mPlayer.enqueue(item);
326 PlaylistItem item = getCurrentItem();
327 if (item == null || !item.getItemId().equals(iid)) {
333 PlaylistItem item = getCurrentItem();
334 if (item != null) {
335 if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PENDING) {
336 item.setState(mPaused ? MediaItemStatus.PLAYBACK_STATE_PAUSED
339 mPlayer.play(item);
341 } else if (mPaused && item.getState() == MediaItemStatus.PLAYBACK_STATE_PLAYING) {
343 item.setState(MediaItemStatus.PLAYBACK_STATE_PAUSED);
344 } else if (!mPaused && item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED) {
346 item.setState(MediaItemStatus.PLAYBACK_STATE_PLAYING);
348 // notify client that item playback status has changed
350 mCallback.onItemChanged(item);
363 for (PlaylistItem item : mPlaylist) {
364 if (iid.equals(item.getItemId())) {
366 mPlayer.remove(item.getRemoteItemId());
367 } else if (item.getState() == MediaItemStatus.PLAYBACK_STATE_PLAYING
368 || item.getState() == MediaItemStatus.PLAYBACK_STATE_PAUSED){
371 item.setState(state);
372 found = item;
373 // notify client that item is now removed
378 queue.add(item);
385 log("item not found");
391 PlaylistItem item = getCurrentItem();
392 if (item != null) {
393 removeItem(item.getItemId(), error ?
416 for (PlaylistItem item : mPlaylist) {
417 result += "\n" + item.toString();
427 void onItemChanged(PlaylistItem item);