package com.viaccessorca.voplayerdemo.mediamgt;

public class SubtitleMediaItem extends MediaItem {

	public SubtitleMediaItem(String mediaId, String mediaUri, String displayName) {
		super(mediaId, mediaUri, displayName);
		this.mediaType = MediaType.SUBTITLE_FILE;
	}


	@Override
	public int compareTo(MediaItem another) {

		switch(another.mediaType) {

		case HTTP_STREAMING_MEDIA:
		case HTTP_STREAMING_MEDIA_EBD:
        case MEDIA_PLAYLIST:
		case LOCAL_MEDIA:
			return -1;

		case SUBTITLE_FILE:
			return this.displayName.compareToIgnoreCase(another.displayName);

		case UNKNOWN:
		default:
			return 1;
		}
	}
}

