| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -23,42 +23,44 @@ How To Use It | |||
| 23 | 23 | ------------- | |
| 24 | 24 | ||
| 25 | 25 | In its simplest form: | |
| 26 | - | ||
| 27 | - `ID3.loadTags("filename.mp3", function() { | ||
| 26 | + ``` | ||
| 27 | + ID3.loadTags("filename.mp3", function() { | ||
| 28 | 28 | var tags = ID3.getAllTags(filename); | |
| 29 | 29 | alert(tags.artist + " - " + tags.title + ", " + tags.album); | |
| 30 | - });` | ||
| 30 | + }); | ||
| 31 | + ``` | ||
| 31 | 32 | ||
| 32 | 33 | by specifying specific tags: | |
| 33 | - | ||
| 34 | - `ID3.loadTags("filename.mp3", function() { | ||
| 34 | + ``` | ||
| 35 | + ID3.loadTags("filename.mp3", function() { | ||
| 35 | 36 | var tags = ID3.getAllTags(filename); | |
| 36 | 37 | alert(tags.COMM.data + " - " + tags.TCON.data + ", " + tags.WXXX.data); | |
| 37 | 38 | }, | |
| 38 | - {tags: ["COMM", "TCON", "WXXX"]});` | ||
| 39 | + {tags: ["COMM", "TCON", "WXXX"]}); | ||
| 40 | + ``` | ||
| 39 | 41 | ||
| 40 | 42 | or even by specifying shortcuts instead of cryptic tags: | |
| 41 | - | ||
| 42 | - `ID3.loadTags("filename.mp3", function() { | ||
| 43 | + ``` | ||
| 44 | + ID3.loadTags("filename.mp3", function() { | ||
| 43 | 45 | var tags = ID3.getAllTags(filename); | |
| 44 | 46 | alert(tags.comment + " - " + tags.track + ", " + tags.lyrics); | |
| 45 | 47 | }, | |
| 46 | - {tags: ["comment", "track", "lyrics"]});` | ||
| 47 | - | ||
| 48 | + {tags: ["comment", "track", "lyrics"]}); | ||
| 49 | + ``` | ||
| 48 | 50 | Documentation | |
| 49 | 51 | ------------- | |
| 50 | 52 | ||
| 51 | - `ID3.loadTags(url, cb, [options])` | ||
| 52 | - `url` - The URL of the mp3 file to read, this must reside on the same domain (document.domain). | ||
| 53 | - `cb` - The callback function to invoke when the tags are loaded. | ||
| 53 | + `ID3.loadTags(url, cb, [options])` | ||
| 54 | + `url` - The URL of the mp3 file to read, this must reside on the same domain (document.domain). | ||
| 55 | + `cb` - The callback function to invoke when the tags are loaded. | ||
| 54 | 56 | `options` - Optional parameters. | |
| 55 | 57 | `options.tags` - The array of tags and/or shortcuts to read from the ID3 block. Default value is: `["title", "artist", "album", "track"]` | |
| 56 | 58 | `options.dataReader` - The function used to create the data reader out of a url. It receives (`url`, `success`: callback function that returns the data reader, `fail`: callback function to inform an error setting up the reader). By default it will be BufferedBinaryAjax. | |
| 57 | - | ||
| 58 | - `ID3.getAllTags(url)` | ||
| 59 | - `url` - The URL of the mp3 file to read, this must be the same value given to `ID3.loadTags()`. | ||
| 59 | + | ||
| 60 | + `ID3.getAllTags(url)` | ||
| 61 | + `url` - The URL of the mp3 file to read, this must be the same value given to `ID3.loadTags()`. | ||
| 60 | 62 | `return value` - This function will return the following object structure, for IDv1: | |
| 61 | - | ||
| 63 | + | ||
| 62 | 64 | { | |
| 63 | 65 | version: "1.1", | |
| 64 | 66 | title: string, | |
@@ -68,7 +70,7 @@ Documentation | |||
| 68 | 70 | comment: string, | |
| 69 | 71 | track: string, | |
| 70 | 72 | genre: string | |
| 71 | - } | ||
| 73 | + } | ||
| 72 | 74 | for ID3v2: | |
| 73 | 75 | ||
| 74 | 76 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments