Class MediaTransportConfigurationGoogleCloud

Object
com.wowza.wms.transport.media.MediaTransportConfigurationBase
com.wowza.wms.transport.media.MediaTransportConfigurationGoogleCloud
All Implemented Interfaces:
IMediaTransportProviderConfiguration

public class MediaTransportConfigurationGoogleCloud extends com.wowza.wms.transport.media.MediaTransportConfigurationBase
This is a base configuration object for Google Cloud Storage for the MediaTransport System //Example use
//Create a main transport object

MediaTransport transport = new MediaTransport();

//Create an Amazon Transport Provider
MediaTransportProviderGoogleCloud googleTransport = new MediaTransportProviderGoogleCloud();

//Create an Amazon Configuration Object
MediaTransportConfigurationGoogleCloud googleConfig = new MediaTransportConfigurationGoogleCloud();

//Configure the Amazon object with the required parameters
googleConfig.setAttributeString(MediaTransportConfigurationGoogleCloud.GC_CONFIG_BUCKET, this.bucketName);
googleConfig.setAttributeString(MediaTransportConfigurationGoogleCloud.GC_CONFIG_SECRETACCESSKEY, this.secretKey);
googleConfig.setAttributeString(MediaTransportConfigurationGoogleCloud.GC_CONFIG_SERVICEID, this.serviceID);
googleConfig.setAttributeString(MediaTransportConfigurationGoogleCloud.GC_CONFIG_PROJECT_ID, this.projectID);

//Add the configuration item to the provider
googleTransport.setTransportProviderConfiguration(googleConfig);

//Set the type of processing to occur, the default is ASYNC, set to SYNC
//Async will use a thread pool to handle transports, SYNC will block and do them in the order
//they are provided
googleTransport.setTransportProcessType(IMediaTransportProvider.TRANSPORT_PROVIDER_PROCESS_SYNC);

//Initialize the provider
googleTransport.init();

//Add the transport provided to the media transport system
transport.addTransportProvider(googleTransport);

//You can add multiple transport providers

//To push a data block into the transport system the following example should be followed

//Lets assume you have a byte array, say from loading a file into this array.
byte[] fileBytes = getBytesFromFile(uploadFile);

//Create a data object and set up various settings.
MediaTransportDataObject transportDataObject = new MediaTransportDataObject();
transportDataObject.setPath("/"+filename);
transportDataObject.setContentType("video/mp4");
transportDataObject.setData(fileBytes);
transportDataObject.setCommand("PUT");

//Put the object into the transport system
trasnport.addTransportDataObject(transportDataObject);

// There are several listeners you can use to determine if the transport provider was added
// and the return status of the object presented to the system.