src/MediaServices/MediaServicesRestProxy.php
public function sendStartAdvertisementChannelOperation($channel, $duration, $cueId, $showSlate)
    {
        $channelId = Utilities::getEntityId(
            $channel,
            'WindowsAzure\MediaServices\Models\Channel'
        );
        $headers = [
            Resources::CONTENT_TYPE => Resources::JSON_CONTENT_TYPE,
        ];
        $body = json_encode([
            'duration' => $duration,
            'cueId' => $cueId,
            'showSlate' => ($showSlate) ? 'true' : 'false',
        ]);

        return $this->_sendOperation(
            $body,
            "Channels('{$channelId}')/StartAdvertisement",
            Resources::HTTP_POST,
            Resources::STATUS_ACCEPTED,
            $headers);
    }
public function sendStartAdvertisementChannelOperation($channel, $duration, $cueId, $showSlate)
    {
        $channelId = Utilities::getEntityId(
            $channel,
            'WindowsAzure\MediaServices\Models\Channel'
        );
        $headers = [
            Resources::CONTENT_TYPE => Resources::JSON_CONTENT_TYPE,
        ];
        $body = json_encode([
            'duration' => $duration,
            'cueId' => $cueId,
            'showSlate' => ($showSlate) ? 'true' : 'false',
        ]);

        return $this->_sendOperation(
            $body,
            "Channels('{$channelId}')/StartAdvertisement",
            Resources::HTTP_POST,
            Resources::STATUS_ACCEPTED,
            $headers);
    }
public function sendStartAdvertisementChannelOperation ( $ channel , $ duration , $ cueId , $ showSlate ) { $ channelId = Utilities :: getEntityId ( $ channel , 'WindowsAzure\MediaServices\Models\Channel' ) ; $ headers = [ Resources :: CONTENT_TYPE => Resources :: JSON_CONTENT_TYPE , ] ; $ body = json_encode ( [ 'duration' => $ duration , 'cueId' => $ cueId , 'showSlate' => ( $ showSlate ) ? 'true' : 'false' , ] ) ; return $ this -> _sendOperation ( $ body , "Channels('{$channelId}')/StartAdvertisement" , Resources :: HTTP_POST , Resources :: STATUS_ACCEPTED , $ headers ) ; }
StartAdvertisement on a running channel.

@param Channel|string $channel   Channel data or channel Id
@param string         $duration  The duration, in seconds, of the commercial break
@param string         $cueId     Unique ID for the commercial break
@param string         $showSlate Indicates to the live encoder within the Channel that it needs to switch to the
default slate image during the commercial break

@return Operation
StartAdvertisement on a running channel .