You can extract metadata information from multimedia files. Metadata is the information about multimedia files.
The main feature of the Metadata API is to extract metadata from a file. You can extract metadata from multimedia files using the
<!-- for accessing internal storage only --> <tizen:privilege name="http://tizen.org/privilege/mediastorage"/> <!-- for accessing external storage only --> <tizen:privilege name="http://tizen.org/privilege/externalstorage"/>
Additionally, to access files using the Metadata API (in mobile and wearable applications), the application has to request proper storage permissions using the PPM API (in mobile and wearable applications).
Create a file handle using the
var filePath = "videos/sample_video.mp4"; var fileHandle = tizen.metadata.createFileHandle(filePath);
When the file handle is properly created, metadata can be extracted:
console.log("Video duration is: " + fileHandle.get("DURATION") + " milliseconds"); console.log("Video title is: " + fileHandle.get("TITLE"));
For better performance, the file handle does not release underlying resources after every metadata extraction. The data is decoded on the first extraction, which helps in speeding up the next metadata extractions. When all the needed metadata is extracted, the file handle needs to be released using the
- Tizen 6.0 and Higher for Mobile
- Tizen 6.0 and Higher for Wearable
- Tizen 6.0 and Higher for TV