+ const children = {}
+
+ if (options.previousVideo) {
+ const buttonOptions: NextPreviousVideoButtonOptions = {
+ type: 'previous',
+ handler: options.previousVideo,
+ isDisabled: () => {
+ if (!options.hasPreviousVideo) return false
+
+ return !options.hasPreviousVideo()
+ }
+ }
+
+ Object.assign(children, {
+ 'previousVideoButton': buttonOptions
+ })
+ }
+
+ Object.assign(children, { playToggle: {} })
+
+ if (options.nextVideo) {
+ const buttonOptions: NextPreviousVideoButtonOptions = {
+ type: 'next',
+ handler: options.nextVideo,
+ isDisabled: () => {
+ if (!options.hasNextVideo) return false
+
+ return !options.hasNextVideo()
+ }
+ }
+
+ Object.assign(children, {
+ 'nextVideoButton': buttonOptions
+ })
+ }
+
+ Object.assign(children, {