|
Example_Video_YouTube
notes about integration with youtube videos
Phase-Deploy Example: YouTube video integrationThe pgn4web chessboard follows the game played in the YouTube video. You can add a similar page to your website or to a chess blog.
instructionsThe video integration is achieved using the video.html file with the appropriate parameters to select the youtube video. Browsing to video.html?help=true shows all the configuration options for video.html. video.html requires video timing information to be added to the PGN data. Here is an example of a PGN data for use with video.html: [Event "WCh W Blitz Final"]
[Site "Moscow RUS"]
[Date "2010.09.18"]
[Round "30"]
[White "Krush, Irina"]
[Black "Kosteniuk, Alexandra"]
[Result "0-1"]
[TimeControl "180+2"]
[WhiteClock "3:02"]
[BlackClock "3:02"]
[VideoTime "2"]
1. d4 {[%vt 18.6] [%clk 3.03]}
1... Nf6 {[%vt 19.4] [%clk 3.03]}
2. c4 {[%vt 20.1] [%clk 3.04]}
2... e6 {[%vt 20.7] [%clk 3.05]}
3. Nc3 {[%vt 21.3] [%clk 3.03]}
3... Bb4 {[%vt 22.6] [%clk 3.06]}
...The [VideoTime "0.0"] tag specifies when during the video playback this game should be loaded. This is useful in case the video shows more than one game. Every game must have this tag (otherwise defaulting to zero). The [%vt 18.5] comment specifies when during the video playback this move should be shown. Every move must have this comment info (otherwise defaulting to zero). All video timing info (header tags and move comments) should be sequential through the PGN data, this means the first game of the video should be the first in the file and so on. If the video shows first game A, then game B, then game A again, the file should contain three games, with A as game number one and three. Clock info ([WhiteClock "3:02"] header tag and [%clk 3.03] move comments) is optional. pgn4web also integrates with HTML5 video. Please note, some older browser might not support this functionality. using the youtube video description as PGN dataWhen the youtubeVideoid=... URL option is used to specify a youtube video, if the pgnData=... URL option is not used, then video.html will use the text of the youtube video description as PGN data. This is an alternative option to storing the PGN data in a separate file. Remember to use the % at the beginning of the line for general comments that could otherwise disrupt the parsing of the PGN data. how to generate the video timing infovideo.html provides a facility to interactively add video timing information to the PGN. Use the videoUrl=... and the pgnData=... URL options to specify your video and the associated PGN file. Then add the setupVideotimes=true option. In this mode, while the video is playing, clicking the capture button will add video timing info to the next game or move. After all games and moves have been updated with video timing info, you can copy the PGN data from the textbox for replacing your original PGN file. step by step
The steps above require ownership of the youtube video in order to add the PGN data to the video description. In order to use a third party youtube video, it is possible to refer to PGN data from a file local to video.html using the pgnData=... URL option, similar to these step by step instructions |