https://github.com/doist/todoistmediaparser
Parses media links for more information like a thumbnail url, type and mime type.
https://github.com/doist/todoistmediaparser
Last synced: 22 days ago
JSON representation
Parses media links for more information like a thumbnail url, type and mime type.
- Host: GitHub
- URL: https://github.com/doist/todoistmediaparser
- Owner: Doist
- License: mit
- Created: 2014-03-22T15:13:57.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2022-02-01T19:19:26.000Z (over 4 years ago)
- Last Synced: 2025-01-16T23:43:31.255Z (over 1 year ago)
- Language: Java
- Size: 163 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Media Parser #
Simple Java library to ease integration with media. Useful for obtaining direct links to media content, thumbnails, mime types, and other useful data.
## Usage ##
To get a media parser for an url (or `null` if there's none that supports it), call:
```
MediaParser mediaParser = MediaParser.getInstance(url);
```
To get a direct link to this content, use:
```
mediaParser.getContentUrl(); // Same as `getUrl()` when there's no direct link.
```
To get the type of the content `getContentUrl()` returns, use:
```
mediaParser.getContentMediaType(); // Type.IMAGE, Type.VIDEO, Type.AUDIO or Type.OTHER.
```
To get an image thumbnail of this content, equal or larger than `smallestSide`, use:
```
mediaParser.getThumbnailUrl(smallestSide); // Can be null.
```
Finally, to know if the thumbnail can be obtained immedately or if it requires additonal work (like http requests), use:
```
public boolean isThumbnailImmediate(int smallestSide);
```
## Supported services
Besides urls which point directly to image, video and audio files, these services are also supported:
- deviantart.com
- flickr.com
- hulu.com
- img.ly
- instagr.am
- justin.tv
- rdio.com
- screenr.com
- slideshare.com
- soundcloud.com
- spotify.com
- ted.com
- twitpic.com
- vimeo.com
- yfrog.com
- youtube.com