YouTube offers various optional features. You can use such features in the game to hold various events.
Play YouTube via URL
When user plays a YouTube video via URL, it is run on YouTube application or web browser (e.g., Chrome, Safari) depending on the app existence. To display captions on video clips in the two environment mentioned above, make sure to process the following settings.
Caption Display on App
When you register a YouTube video, add the ‘yt:cc=on‘ tag. Videos with this tag display subtitles even if user already set subtitles/CC Off while watching other video clips. The subtitle language with this settings is selected by YouTube.
Caption Display on Web Browser
It is available to set subtitle language and forcible subtitle display by using YouTube Embed URL. Parameter named cc_load_policy determines whether to display subtitle forcibly or not, and hl determines the subtitle language.
– Template: https://www.youtube.com/embed/Video ID}?cc_load_policy={whether to display subtitle forcibly}&hl={subtitle language}
– Example: https://www.youtube.com/embed/4Fpeq3R0QXE?cc_load_policy=1&hl=ko
Play YouTube on Hive
When playing YouTube videos on Hive, you can take advantage of the various options below. If you request the required option values in the development process, they will be applied during the event page development stage.
Option Name | Code | Description |
---|---|---|
Automatic Playback | autoplay | You can set whether or not to auto-play videos. |
Subtitle | cc_load_policy | You can set whether or not to display subtitles in the video. If you don’t set up the language value (hl option below), the language will be determined by the YouTube’s algorithm. |
Controller | controls | You can set whether or not to display the video controller. |
Start Time | start | You can set the time when you want to start playing the video. |
End Time | end | You can set the time when you want to stop playing the video. |
Full Screen | fs | You can set whether or not to display the full screen button on the video controller. |
Language Value | hl | You can set the video interface and subtitle language values. These values will determine all languages, such as video title and subtitles. If the value is not set, the YouTube’s algorithm will determine which language to expose. |
Special Effect | iv_load_policy | You can set whether or not to display the special effects of a video. This option will only work when the Controls option is disabled. |
Repeat | loop | You can set whether to play the video repeatedly after it finishes playing. |
Show YouTube Logo | modestbranding | You can set whether or not to expose the YouTube logo during video playback. This option will only work when the Controls option is disabled. |
Playlist | playlist | You can set whether or not to expose a comma-separated list of video IDs to play. |
Play Screen Type | playinline | You can set whether or not to play a video in a webview or a full screen on iOS. We recommend playing videos in webviews. |
Show Related Videos | rel | You can set whether or not to show related videos when a video is finished playing. |
Show Related Info | showinfo | Before start playing a video, you can set whether or not to display information about the video. |