> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XGameStreamingIsStreaming

> XGameStreamingIsStreaming

# XGameStreamingIsStreaming

判斷遊戲目前是否正在串流。

## 語法

```cpp theme={null}
bool XGameStreamingIsStreaming();
```

### 傳回值

類型：bool

如果遊戲正在至少連線一個串流用戶端裝置的 XBOX 上執行，`XGameStreamingIsStreaming` 會傳回 true。

## 備註

`XGameStreamingIsStreaming` 不會區分主機是透過遠端遊玩 (Remote Play) 還是透過 XBOX 遊戲串流進行串流。

若要在個別串流用戶端裝置連線及/或中斷連線時收到通知，請考慮透過 [XGameStreamingRegisterConnectionStateChanged](/zh-TW/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged) 註冊回呼。

## 範例

```C++ theme={null}
 if (XGameStreamingIsStreaming())
 {
     // The game is currently streaming to at least one device
     // Enable any customizations that might be useful when running from the cloud
 }
```

## 需求

**標頭：** xgamestreaming.h

**程式庫：** xgameruntime.lib

**支援的平台：** Windows、XBOX One 系列主機和 XBOX Series 主機

## 另請參閱

[XGameStreamingConnectionState](/zh-TW/reference/system/xgamestreaming/enums/xgamestreamingconnectionstate)\
[XGameStreamingUnregisterConnectionStateChanged](/zh-TW/reference/system/xgamestreaming/functions/xgamestreamingunregisterconnectionstatechanged)\
[XGameStreamingRegisterConnectionStateChanged](/zh-TW/reference/system/xgamestreaming/functions/xgamestreamingregisterconnectionstatechanged)\
[XGameStreaming](/zh-TW/reference/system/xgamestreaming/xgamestreaming_members#ConnectionState)


## Related topics

- [XGameStreamingIsStreaming](/reference/system/xgamestreaming/functions/xgamestreamingisstreaming.md)
- [XGameStreaming](/reference/system/xgamestreaming/xgamestreaming_members.md)
- [XGameStreamingGetClients](/reference/system/xgamestreaming/functions/xgamestreaminggetclients.md)
