The object which represents a media content (audio, image, video) or a container (folder). An Item object will be retrieved by browse() or search() in provider APIs. Also, an Item object can be built with a local content or a web content with constructor.

varserviceProvider;// it is assumed that you has obtained a serviceProvider object.// For further details, see the createServiceProvider() or getServiceProvider().varlocalContentsPath="file://Videos/clip.mp4";varwebContentsUri="http://mediashare.com/videos/clip.mp4";varmimeType="video/mp4";// Type 1. create item with a local content.varlocalItem=newItem(localContentsPath,mimeType."Local Video Clip");// Type 2. create item with a web content.varwebItem=newItem(webContentsUri,mimeType."Web Video Clip");// Type 3. retrieve an item from a remote provider.varproviderItem;//Define browse callbackfunctionbrowseCB(list,endOfItem,provider){providerItem=list[0];}functionerrorCB(error,device){console.log(device+" raises "+error);}// Define success callback for creating ServiceProviderfunctionsProviderCallback(provider){// Obtaining service provider instance.serviceProvider=provider;try{varproviders=serviceProvider.getDeviceFinder().getDevices("MEDIAPROVIDER");if(providers.length>0){// retrieves first DMS from the root folderproviders[0].browse(providers[0].rootFolder,0,1,browseCB,errorCB);}}catch(e){console.log(e.message);}}// Define error callback for creating ServiceProviderfunctioneProviderCallback(error,state){console.log(error.name);console.log("Service state: "+state);}try{webapis.allshare.serviceconnector.createServiceProvider(sProviderCallback,eProviderCallback);}catch(e){console.log(e.message);}

ATTRIBUTES

readonlyDOMStringalbumTitle

Content album title.

If it’s itemType value is “FOLDER”, “undefined” returns.

This attribute is readonly.

readonlyDOMStringartist

Content artist.

If it’s itemType value isn’t a “AUDIO”, “undefined” returns.

This attribute is readonly.

readonlyDatedate

Content date.

If it’s itemType value is “FOLDER”, “undefined” returns.

This attribute is readonly.

readonlyunsignedlonglongduration

Content total play time.

If it’s itemType value is “FOLDER” or “IMAGE”, “undefined” returns.

This attribute is readonly.

readonlyDOMStringextension

Content extension.

If it’s itemType value is “FOLDER”, “undefined” returns.

This attribute is readonly.

readonlydoublefileSize

Content file size.

If it’s itemType value is a “FOLDER”, “undefined” returns.

This attribute is readonly.

readonlyDOMStringgenre

Content genre.

If it’s itemType value is not an “AUDIO”, “undefined” returns.

This attribute is readonly.

readonlySimpleCoordinates?location

Content geo-location.

if the itemType value is a “FOLDER”, “undefined” returns.

This attribute is readonly.

readonlyDOMStringmimeType

Content MIME type.

This attribute is readonly.

readonlyunsignedlongwidth

Content width.

If it’s itemType value is not an “IMAGE” or “VIDEO”, “undefined” returns.

This attribute is readonly.

readonlyunsignedlongheight

Content height.

If it’s itemType value is an “IMAGE” or “VIDEO”, “undefined” returns.

This attribute is readonly.

readonlyDOMStringsubtitleUri

Content subtitle URI.

If it’s itemType value is not a “VIDEO”, “undefined” returns.

This attribute is readonly.

readonlyDOMStringthumbnailUri

Content thumbnail URI.

If it’s itemType value is not an “IMAGE” or “VIDEO”, “undefined” returns.