From 57df727562baf9f515fca4389ec6bc824238ece9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Fri, 24 Jun 2016 09:02:06 +0200 Subject: [PATCH 01/65] Point badges to the develop branch --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ea1fddfe..48c69a0b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ## About -[![Build Status](https://img.shields.io/travis/0xced/XCDYouTubeKit/master.svg?style=flat)](https://travis-ci.org/0xced/XCDYouTubeKit) -[![Coverage Status](https://img.shields.io/coveralls/0xced/XCDYouTubeKit/master.svg?style=flat)](https://coveralls.io/r/0xced/XCDYouTubeKit?branch=master) +[![Build Status](https://img.shields.io/travis/0xced/XCDYouTubeKit/develop.svg?style=flat)](https://travis-ci.org/0xced/XCDYouTubeKit) +[![Coverage Status](https://img.shields.io/coveralls/0xced/XCDYouTubeKit/develop.svg?style=flat)](https://coveralls.io/r/0xced/XCDYouTubeKit?branch=develop) [![Platform](https://img.shields.io/cocoapods/p/XCDYouTubeKit.svg?style=flat)](http://cocoadocs.org/docsets/XCDYouTubeKit/) [![Pod Version](https://img.shields.io/cocoapods/v/XCDYouTubeKit.svg?style=flat)](https://cocoapods.org/pods/XCDYouTubeKit) [![Carthage Compatibility](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage/) From 2c15a96204efde55118c01a139c846526d8a9a35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Sun, 2 Oct 2016 20:49:34 +0200 Subject: [PATCH 02/65] Adapt the playground to work with both Xcode 7 and 8 --- .../Playground.playground/Contents.swift | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/XCDYouTubeKit Demo/Playground.playground/Contents.swift b/XCDYouTubeKit Demo/Playground.playground/Contents.swift index e5353073..91df0201 100644 --- a/XCDYouTubeKit Demo/Playground.playground/Contents.swift +++ b/XCDYouTubeKit Demo/Playground.playground/Contents.swift @@ -1,18 +1,27 @@ -import XCPlayground import XCDYouTubeKit +#if swift(>=3.0) + import PlaygroundSupport +#else + import XCPlayground + typealias Error = NSError +#endif setenv("XCDYouTubeKitLogLevel", "0", 1) var client = XCDYouTubeClient(languageIdentifier: "en") -client.getVideoWithIdentifier("6v2L2UGZJAM") { (video: XCDYouTubeVideo?, error: NSError?) -> Void in +client.getVideoWithIdentifier("6v2L2UGZJAM") { (video: XCDYouTubeVideo?, error: Error?) -> Void in video error?.localizedDescription } -client.getVideoWithIdentifier("xxxxxxxxxxx") { (video: XCDYouTubeVideo?, error: NSError?) -> Void in +client.getVideoWithIdentifier("xxxxxxxxxxx") { (video: XCDYouTubeVideo?, error: Error?) -> Void in video error?.localizedDescription } -XCPlaygroundPage.currentPage.needsIndefiniteExecution = true +#if swift(>=3.0) + PlaygroundPage.current.needsIndefiniteExecution = true +#else + XCPlaygroundPage.currentPage.needsIndefiniteExecution = true +#endif From 626c158eabf963d0c0c8e83fad42e77684d93e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Mon, 3 Oct 2016 00:52:07 +0200 Subject: [PATCH 03/65] Use a single scheme for XCDYouTubeKit framework and tests Thanks to http://promisekit.org/news/2016/08/Multiplatform-Single-Scheme-Xcode-Projects/ --- .travis.yml | 26 +- Scripts/run-tests.sh | 2 +- .../project.pbxproj | 4 +- .../XCDYouTubeKit OS X Demo.xcscheme | 9 +- .../xcschemes/XCDYouTubeKit iOS Demo.xcscheme | 7 +- .../XCDYouTubeKit tvOS Demo.xcscheme | 13 +- XCDYouTubeKit.xcodeproj/project.pbxproj | 819 +++--------------- ...cheme => XCDYouTubeKit Framework.xcscheme} | 15 +- .../XCDYouTubeKit OS X Tests.xcscheme | 72 -- .../xcschemes/XCDYouTubeKit OS X.xcscheme | 116 --- ... => XCDYouTubeKit Static Library.xcscheme} | 12 +- ....xcscheme => XCDYouTubeKit Tests.xcscheme} | 8 +- .../XCDYouTubeKit tvOS Tests.xcscheme | 72 -- .../xcschemes/XCDYouTubeKit tvOS.xcscheme | 120 --- 14 files changed, 150 insertions(+), 1145 deletions(-) rename XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/{XCDYouTubeKit iOS Framework.xcscheme => XCDYouTubeKit Framework.xcscheme} (89%) delete mode 100644 XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X Tests.xcscheme delete mode 100644 XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X.xcscheme rename XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/{XCDYouTubeKit iOS Static Library.xcscheme => XCDYouTubeKit Static Library.xcscheme} (91%) rename XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/{XCDYouTubeKit iOS Tests.xcscheme => XCDYouTubeKit Tests.xcscheme} (90%) delete mode 100644 XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS Tests.xcscheme delete mode 100644 XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS.xcscheme diff --git a/.travis.yml b/.travis.yml index 357bffeb..4bb4306b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,19 +2,19 @@ osx_image: xcode7.3 language: objective-c env: matrix: - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s" CONFIGURATION="Code Coverage" SCHEME="XCDYouTubeKit iOS Static Library" OBJROOT="build"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.1" CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.4" CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.0" CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3" CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3" CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library" IPHONEOS_DEPLOYMENT_TARGET="9.3"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 4s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Static Library" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 4s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Framework" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit iOS Framework" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=OS X" CONFIGURATION="Release" SCHEME="XCDYouTubeKit OS X" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=OS X" CONFIGURATION="Release" SCHEME="XCDYouTubeKit OS X" MACOSX_DEPLOYMENT_TARGET="10.11"' - - 'DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p" CONFIGURATION="Release" SCHEME="XCDYouTubeKit tvOS" RUN_CLANG_STATIC_ANALYZER="YES"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s" CONFIGURATION="Code Coverage" SCHEME="XCDYouTubeKit Static Library" OBJROOT="build"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.1" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.4" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.0" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library" IPHONEOS_DEPLOYMENT_TARGET="9.3"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 4s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library" RUN_CLANG_STATIC_ANALYZER="YES"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library" RUN_CLANG_STATIC_ANALYZER="YES"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 4s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" RUN_CLANG_STATIC_ANALYZER="YES"' + - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" RUN_CLANG_STATIC_ANALYZER="YES"' + - 'DESTINATION="platform=OS X" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" RUN_CLANG_STATIC_ANALYZER="YES"' + - 'DESTINATION="platform=OS X" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" MACOSX_DEPLOYMENT_TARGET="10.11"' + - 'DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" RUN_CLANG_STATIC_ANALYZER="YES"' install: - gem install xcpretty-travis-formatter --no-rdoc --no-ri --no-document --quiet - sudo easy_install cpp-coveralls diff --git a/Scripts/run-tests.sh b/Scripts/run-tests.sh index e8760d1a..1069adc5 100755 --- a/Scripts/run-tests.sh +++ b/Scripts/run-tests.sh @@ -2,7 +2,7 @@ set -o pipefail -: ${SCHEME:="XCDYouTubeKit iOS Static Library"} +: ${SCHEME:="XCDYouTubeKit Static Library"} : ${CONFIGURATION:="Release"} : ${DESTINATION:="platform=iOS Simulator,name=iPhone 5s"} diff --git a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj index 728e1687..5ce1d22c 100644 --- a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj +++ b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj @@ -783,7 +783,6 @@ MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; }; name = Debug; @@ -823,7 +822,6 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; MACOSX_DEPLOYMENT_TARGET = 10.9; SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; TVOS_DEPLOYMENT_TARGET = 9.0; VALIDATE_PRODUCT = YES; }; @@ -839,6 +837,7 @@ LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = ch.pitaya.xcdyoutubekit.demo.ios; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; }; name = Debug; @@ -853,6 +852,7 @@ LD_RUNPATH_SEARCH_PATHS = "@loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = ch.pitaya.xcdyoutubekit.demo.ios; PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; WRAPPER_EXTENSION = app; }; name = Release; diff --git a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X Demo.xcscheme b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X Demo.xcscheme index f5742813..2f7ade63 100644 --- a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X Demo.xcscheme +++ b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X Demo.xcscheme @@ -11,8 +11,7 @@ buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" - buildForAnalyzing = "YES" - hideIssues = "NO"> + buildForAnalyzing = "YES"> diff --git a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Demo.xcscheme b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Demo.xcscheme index 8633ada4..63847d38 100644 --- a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Demo.xcscheme +++ b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Demo.xcscheme @@ -11,8 +11,7 @@ buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" - buildForAnalyzing = "YES" - hideIssues = "NO"> + buildForAnalyzing = "YES"> diff --git a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS Demo.xcscheme b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS Demo.xcscheme index 8f88545b..c691d0c1 100644 --- a/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS Demo.xcscheme +++ b/XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS Demo.xcscheme @@ -11,8 +11,7 @@ buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" - buildForAnalyzing = "YES" - hideIssues = "NO"> + buildForAnalyzing = "YES"> + + + + @@ -26,15 +26,16 @@ buildConfiguration = "Code Coverage" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" - shouldUseLaunchSchemeArgsEnv = "NO"> + shouldUseLaunchSchemeArgsEnv = "NO" + codeCoverageEnabled = "YES"> @@ -44,7 +45,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "C2F0E5721944F10E00D8EBA8" BuildableName = "XCDYouTubeKit.framework" - BlueprintName = "XCDYouTubeKit iOS Framework" + BlueprintName = "XCDYouTubeKit Framework" ReferencedContainer = "container:XCDYouTubeKit.xcodeproj"> @@ -74,7 +75,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "C2F0E5721944F10E00D8EBA8" BuildableName = "XCDYouTubeKit.framework" - BlueprintName = "XCDYouTubeKit iOS Framework" + BlueprintName = "XCDYouTubeKit Framework" ReferencedContainer = "container:XCDYouTubeKit.xcodeproj"> @@ -92,7 +93,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "C2F0E5721944F10E00D8EBA8" BuildableName = "XCDYouTubeKit.framework" - BlueprintName = "XCDYouTubeKit iOS Framework" + BlueprintName = "XCDYouTubeKit Framework" ReferencedContainer = "container:XCDYouTubeKit.xcodeproj"> diff --git a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X Tests.xcscheme b/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X Tests.xcscheme deleted file mode 100644 index aa2d32a1..00000000 --- a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X Tests.xcscheme +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X.xcscheme b/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X.xcscheme deleted file mode 100644 index 76d4f7f1..00000000 --- a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit OS X.xcscheme +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Static Library.xcscheme b/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit Static Library.xcscheme similarity index 91% rename from XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Static Library.xcscheme rename to XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit Static Library.xcscheme index b6d8e0a0..1a9371da 100644 --- a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Static Library.xcscheme +++ b/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit Static Library.xcscheme @@ -16,7 +16,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "C2A3F2CC17F4827800AC1C3B" BuildableName = "libXCDYouTubeKit.a" - BlueprintName = "XCDYouTubeKit iOS Static Library" + BlueprintName = "XCDYouTubeKit Static Library" ReferencedContainer = "container:XCDYouTubeKit.xcodeproj"> @@ -33,8 +33,8 @@ @@ -44,7 +44,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "C2A3F2CC17F4827800AC1C3B" BuildableName = "libXCDYouTubeKit.a" - BlueprintName = "XCDYouTubeKit iOS Static Library" + BlueprintName = "XCDYouTubeKit Static Library" ReferencedContainer = "container:XCDYouTubeKit.xcodeproj"> @@ -83,7 +83,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "C2A3F2CC17F4827800AC1C3B" BuildableName = "libXCDYouTubeKit.a" - BlueprintName = "XCDYouTubeKit iOS Static Library" + BlueprintName = "XCDYouTubeKit Static Library" ReferencedContainer = "container:XCDYouTubeKit.xcodeproj"> @@ -101,7 +101,7 @@ BuildableIdentifier = "primary" BlueprintIdentifier = "C2A3F2CC17F4827800AC1C3B" BuildableName = "libXCDYouTubeKit.a" - BlueprintName = "XCDYouTubeKit iOS Static Library" + BlueprintName = "XCDYouTubeKit Static Library" ReferencedContainer = "container:XCDYouTubeKit.xcodeproj"> diff --git a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Tests.xcscheme b/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit Tests.xcscheme similarity index 90% rename from XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Tests.xcscheme rename to XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit Tests.xcscheme index 4e0260a8..3b6b1de2 100644 --- a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit iOS Tests.xcscheme +++ b/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit Tests.xcscheme @@ -15,8 +15,8 @@ @@ -33,8 +33,8 @@ diff --git a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS Tests.xcscheme b/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS Tests.xcscheme deleted file mode 100644 index d7ada830..00000000 --- a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS Tests.xcscheme +++ /dev/null @@ -1,72 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS.xcscheme b/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS.xcscheme deleted file mode 100644 index 2225f846..00000000 --- a/XCDYouTubeKit.xcodeproj/xcshareddata/xcschemes/XCDYouTubeKit tvOS.xcscheme +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From e9d2125114f107470709a3db936353c6975d13c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Mon, 3 Oct 2016 01:04:47 +0200 Subject: [PATCH 04/65] Run unit tests on Travis with scan --- .travis.yml | 43 ++++++++++++++++++++++++------------------- Scanfile | 5 +++++ Scripts/run-tests.sh | 24 ------------------------ 3 files changed, 29 insertions(+), 43 deletions(-) create mode 100644 Scanfile delete mode 100755 Scripts/run-tests.sh diff --git a/.travis.yml b/.travis.yml index 4bb4306b..35b4b1ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,32 +1,37 @@ osx_image: xcode7.3 language: objective-c env: + global: + - 'SCAN_CONFIGURATION="Release"' + - 'SCAN_OUTPUT_TYPES=""' matrix: - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s" CONFIGURATION="Code Coverage" SCHEME="XCDYouTubeKit Static Library" OBJROOT="build"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.1" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.4" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.0" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library" IPHONEOS_DEPLOYMENT_TARGET="9.3"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 4s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Static Library" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 4s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=iOS Simulator,name=iPhone 5s" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=OS X" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" RUN_CLANG_STATIC_ANALYZER="YES"' - - 'DESTINATION="platform=OS X" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" MACOSX_DEPLOYMENT_TARGET="10.11"' - - 'DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p" CONFIGURATION="Release" SCHEME="XCDYouTubeKit Framework" RUN_CLANG_STATIC_ANALYZER="YES"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s" SCAN_CONFIGURATION="Debug" SCAN_XCARGS="OBJROOT=build GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.1"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.4"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.0"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3" SCAN_XCARGS="IPHONEOS_DEPLOYMENT_TARGET=9.3"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 4s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 4s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - 'SCAN_DESTINATION="platform=OS X" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - 'SCAN_DESTINATION="platform=OS X" SCAN_XCARGS="MACOSX_DEPLOYMENT_TARGET=10.11"' + - 'SCAN_DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' install: - - gem install xcpretty-travis-formatter --no-rdoc --no-ri --no-document --quiet + # Need bundler < 1.13.{1,2} because of https://github.com/bundler/bundler/issues/5000 + - gem uninstall bundler -v '>1.12.5' --force || echo "bundler >1.12.5 is not installed" + - gem install bundler -v 1.12.5 --no-rdoc --no-ri --no-document --quiet + - gem install scan --no-rdoc --no-ri --no-document --quiet - sudo easy_install cpp-coveralls - sudo easy_install codecov script: - - open -b com.apple.iphonesimulator # Workaround https://github.com/travis-ci/travis-ci/issues/3040 - - ./Scripts/run-tests.sh + - scan after_success: - - '[ "$CONFIGURATION" == "Code Coverage" ] && coveralls --include XCDYouTubeKit' - - '[ "$CONFIGURATION" == "Code Coverage" ] && codecov --gcov-glob "*XCDYouTubeKit iOS Tests*"' + - '[[ "$SCAN_XCARGS" == *"GCC_GENERATE_TEST_COVERAGE_FILES"* ]] && coveralls --include XCDYouTubeKit' + - '[[ "$SCAN_XCARGS" == *"GCC_GENERATE_TEST_COVERAGE_FILES"* ]] && codecov --gcov-glob "*XCDYouTubeKit iOS Tests*"' after_failure: - - cat xcodebuild.log + - cat ~/Library/Logs/scan/* - cat $TMPDIR/com.apple.dt.XCTest-status/Session*.log - cat ~/Library/Logs/DiagnosticReports/xctest*.crash - sleep 5 diff --git a/Scanfile b/Scanfile new file mode 100644 index 00000000..a8f3127b --- /dev/null +++ b/Scanfile @@ -0,0 +1,5 @@ +# For more information about this configuration visit +# https://github.com/fastlane/fastlane/tree/master/scan#scanfile + +project "XCDYouTubeKit.xcodeproj" +scheme "XCDYouTubeKit Framework" diff --git a/Scripts/run-tests.sh b/Scripts/run-tests.sh deleted file mode 100755 index 1069adc5..00000000 --- a/Scripts/run-tests.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -set -o pipefail - -: ${SCHEME:="XCDYouTubeKit Static Library"} -: ${CONFIGURATION:="Release"} -: ${DESTINATION:="platform=iOS Simulator,name=iPhone 5s"} - -COMMAND="env NSUnbufferedIO=YES xcodebuild clean test -project XCDYouTubeKit.xcodeproj -scheme '${SCHEME}' -configuration '${CONFIGURATION}' -destination '${DESTINATION}'" - -for BUILD_SETTING in OBJROOT RUN_CLANG_STATIC_ANALYZER IPHONEOS_DEPLOYMENT_TARGET MACOSX_DEPLOYMENT_TARGET; do - VALUE=`eval echo \\$"${BUILD_SETTING}"` - if [ ! -z "${VALUE}" ]; then - COMMAND+=" ${BUILD_SETTING}='${VALUE}'" - unset ${BUILD_SETTING} - fi -done - -COMMAND+=" | tee xcodebuild.log" - -xcpretty --version > /dev/null 2>&1 && COMMAND+=" | xcpretty" && [ "${TRAVIS}" == "true" ] && xcpretty-travis-formatter > /dev/null 2>&1 && COMMAND+=" -f `xcpretty-travis-formatter`" - -set -x -eval "${COMMAND}" && rm xcodebuild.log From daae374bb2bce249da7c24fdcc844b6946417d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Mon, 3 Oct 2016 23:31:21 +0200 Subject: [PATCH 05/65] =?UTF-8?q?Add=20Xcode=208=20(iOS=2010=20and=20tvOS?= =?UTF-8?q?=2010)=20in=20Travis=E2=80=99=20build=20matrix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .travis.yml | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 35b4b1ab..2435d6e8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,20 +4,36 @@ env: global: - 'SCAN_CONFIGURATION="Release"' - 'SCAN_OUTPUT_TYPES=""' - matrix: - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s" SCAN_CONFIGURATION="Debug" SCAN_XCARGS="OBJROOT=build GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES"' - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.1"' - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.4"' - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.0"' - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3"' - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3" SCAN_XCARGS="IPHONEOS_DEPLOYMENT_TARGET=9.3"' - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 4s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 4s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' - - 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' - - 'SCAN_DESTINATION="platform=OS X" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' - - 'SCAN_DESTINATION="platform=OS X" SCAN_XCARGS="MACOSX_DEPLOYMENT_TARGET=10.11"' - - 'SCAN_DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' +matrix: + include: + - osx_image: xcode7.3 + env: 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s" SCAN_CONFIGURATION="Debug" SCAN_XCARGS="OBJROOT=build GCC_INSTRUMENT_PROGRAM_FLOW_ARCS=YES GCC_GENERATE_TEST_COVERAGE_FILES=YES"' + - osx_image: xcode7.3 + env: 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.1"' + - osx_image: xcode7.3 + env: 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=8.4"' + - osx_image: xcode7.3 + env: 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.0"' + - osx_image: xcode7.3 + env: 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3"' + - osx_image: xcode7.3 + env: 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=9.3" SCAN_XCARGS="IPHONEOS_DEPLOYMENT_TARGET=9.3"' + - osx_image: xcode8 + env: 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s,OS=10.0" SCAN_XCARGS="IPHONEOS_DEPLOYMENT_TARGET=10.0"' + - osx_image: xcode8 + env: 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 4s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - osx_image: xcode8 + env: 'SCAN_DESTINATION="platform=iOS Simulator,name=iPhone 5s" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - osx_image: xcode7.3 + env: 'SCAN_DESTINATION="platform=OS X" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - osx_image: xcode7.3 + env: 'SCAN_DESTINATION="platform=OS X" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES MACOSX_DEPLOYMENT_TARGET=10.11"' + - osx_image: xcode8 + env: 'SCAN_DESTINATION="platform=OS X" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - osx_image: xcode7.3 + env: 'SCAN_DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES"' + - osx_image: xcode8 + env: 'SCAN_DESTINATION="platform=tvOS Simulator,name=Apple TV 1080p" SCAN_XCARGS="RUN_CLANG_STATIC_ANALYZER=YES TVOS_DEPLOYMENT_TARGET=10.0"' install: # Need bundler < 1.13.{1,2} because of https://github.com/bundler/bundler/issues/5000 - gem uninstall bundler -v '>1.12.5' --force || echo "bundler >1.12.5 is not installed" From 98716f0be000930d257131d6a5022cc61d4e5c5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Tue, 4 Oct 2016 03:10:59 +0200 Subject: [PATCH 06/65] Fix codecov command (do not include tests themselves in coverage) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2435d6e8..098be2be 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,7 +45,7 @@ script: - scan after_success: - '[[ "$SCAN_XCARGS" == *"GCC_GENERATE_TEST_COVERAGE_FILES"* ]] && coveralls --include XCDYouTubeKit' - - '[[ "$SCAN_XCARGS" == *"GCC_GENERATE_TEST_COVERAGE_FILES"* ]] && codecov --gcov-glob "*XCDYouTubeKit iOS Tests*"' + - '[[ "$SCAN_XCARGS" == *"GCC_GENERATE_TEST_COVERAGE_FILES"* ]] && codecov --gcov-glob "*XCDYouTubeKit Tests*"' after_failure: - cat ~/Library/Logs/scan/* - cat $TMPDIR/com.apple.dt.XCTest-status/Session*.log From 73e4675c5b6db3d1eadb716d5620e92a08a37482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Wed, 5 Oct 2016 23:11:47 +0200 Subject: [PATCH 07/65] Try another path for tests session logs --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 098be2be..1ef7520d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -49,5 +49,6 @@ after_success: after_failure: - cat ~/Library/Logs/scan/* - cat $TMPDIR/com.apple.dt.XCTest-status/Session*.log + - cat ~/Library/Developer/Xcode/DerivedData/*/Logs/Test/*/Session*.log - cat ~/Library/Logs/DiagnosticReports/xctest*.crash - sleep 5 From 769d42c5253b778c34810e34046fdbebe5713ab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Tue, 11 Oct 2016 03:57:23 +0200 Subject: [PATCH 08/65] Explicitly launch the simulator before running tests --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 1ef7520d..dd129986 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,6 +42,7 @@ install: - sudo easy_install cpp-coveralls - sudo easy_install codecov script: + - open -b com.apple.iphonesimulator # Workaround https://github.com/travis-ci/travis-ci/issues/3040 and maybe https://github.com/travis-ci/travis-ci/issues/6675 - scan after_success: - '[[ "$SCAN_XCARGS" == *"GCC_GENERATE_TEST_COVERAGE_FILES"* ]] && coveralls --include XCDYouTubeKit' From 3ff75a4bfa08fde50cc73094d778e65a87e43c76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Tue, 11 Oct 2016 07:15:55 +0200 Subject: [PATCH 09/65] Update version in jazzy configuration file too --- Scripts/release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Scripts/release.sh b/Scripts/release.sh index 480374a1..2e3edb6a 100755 --- a/Scripts/release.sh +++ b/Scripts/release.sh @@ -36,11 +36,14 @@ sed -i "" "s/DYLIB_CURRENT_VERSION = .*;/DYLIB_CURRENT_VERSION = ${VERSION};/g" sed -i "" "s/CURRENT_PROJECT_VERSION = .*;/CURRENT_PROJECT_VERSION = ${CURRENT_PROJECT_VERSION};/g" "XCDYouTubeKit.xcodeproj/project.pbxproj" sed -i "" "s/CURRENT_PROJECT_VERSION = .*;/CURRENT_PROJECT_VERSION = ${VERSION};/g" "XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj/project.pbxproj" sed -i "" "s/^\(.*s.version.*=.*\)\".*\"/\1\"${VERSION}\"/" "XCDYouTubeKit.podspec" +sed -i "" "s/module_version: .*/module_version: ${VERSION}/" ".jazzy.yaml" +sed -i "" "s/tree\\/.*\\/XCDYouTubeKit/tree\\/${VERSION}\\/XCDYouTubeKit/" ".jazzy.yaml" sed -E -i "" "s/~> [0-9\.]+/~> ${VERSION_PARTS[0]}.${VERSION_PARTS[1]}/g" "README.md" set +v git add "XCDYouTubeKit.xcodeproj" git add "XCDYouTubeKit Demo/XCDYouTubeKit Demo.xcodeproj" git add "XCDYouTubeKit.podspec" +git add ".jazzy.yaml" git add "README.md" git commit -m "Update version to ${VERSION}" From 8088454b63b5e130bccea1bfbd2fe7592d81071f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ce=CC=81dric=20Luthi?= Date: Thu, 13 Oct 2016 03:56:28 +0200 Subject: [PATCH 10/65] Fix some cassettes testRestrictedVideo and testRestrictedPlaybackErrorNotification were not properly recorded --- .../testRestrictedVideo.json | 108 ++++++----- ...stRestrictedPlaybackErrorNotification.json | 175 +++++++----------- 2 files changed, 130 insertions(+), 153 deletions(-) diff --git a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testRestrictedVideo.json b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testRestrictedVideo.json index f4060231..73d4d81f 100644 --- a/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testRestrictedVideo.json +++ b/XCDYouTubeKit Tests/Cassettes/XCDYouTubeClientTestCase/testRestrictedVideo.json @@ -1,114 +1,122 @@ [ { - "body" : "errordetail=0&status=fail&eventid=5lRUVc7wOtf_cLSGgGA&csi_page_type=embed&c=WEB&errorcode=150&reason=This+video+contains+content+from+Youtube+test+content+owner%2C+who+has+blocked+it+on+copyright+grounds.&enablecsi=1", + "body" : "status=fail&errordetail=0&eventid=Rub-V_7bGYPoWK-lrLAC&c=WEB&cver=1.20161011&csi_page_type=embed&reason=This+video+contains+content+from+Youtube+test+content+owner%2C+who+has+blocked+it+on+copyright+grounds.&enablecsi=1&errorcode=150", "headers" : { - "x-content-type-options" : "nosniff", "Content-Type" : "application\/x-www-form-urlencoded", - "Server" : "gwiseguy\/2.0", - "Cache-Control" : "no-store", - "Accept-Ranges" : "none", - "Date" : "Thu, 14 May 2015 07:55:18 GMT", - "x-frame-options" : "SAMEORIGIN", - "alternate-protocol" : "443:quic,p=1", + "alt-svc" : "quic=\":443\"; ma=2592000; v=\"36,35,34,33,32\"", + "Content-Encoding" : "gzip", + "Server" : "YouTubeFrontEnd", "x-xss-protection" : "1; mode=block; report=https:\/\/www.google.com\/appserve\/security-bugs\/log\/youtube", "Expires" : "Tue, 27 Apr 1971 19:44:06 EST", - "Vary" : "Accept-Encoding" + "Cache-Control" : "no-store", + "Date" : "Thu, 13 Oct 2016 01:41:26 GMT", + "Content-Length" : "206", + "Strict-Transport-Security" : "max-age=31536000", + "x-content-type-options" : "nosniff", + "x-frame-options" : "SAMEORIGIN" }, "method" : "GET", "status" : 200, - "uri" : "https:\/\/www.youtube.com\/get_video_info?eurl=https%3A%2F%2Fyoutube.googleapis.com%2Fv%2F1kIsylLeHHU&hl=en&sts=16560&video_id=1kIsylLeHHU" + "uri" : "https:\/\/www.youtube.com\/get_video_info?eurl=https:\/\/youtube.googleapis.com\/v\/1kIsylLeHHU&hl=en&sts=17082&video_id=1kIsylLeHHU" }, { - "body" : "errordetail=0&errorcode=150&status=fail&reason=This+video+contains+content+from+Youtube+test+content+owner%2C+who+has+blocked+it+on+copyright+grounds.", + "body" : "errorcode=150&errordetail=0&reason=This+video+contains+content+from+Youtube+test+content+owner%2C+who+has+blocked+it+on+copyright+grounds.&status=fail", "headers" : { - "x-content-type-options" : "nosniff", "Content-Type" : "application\/x-www-form-urlencoded", - "Server" : "gwiseguy\/2.0", - "Cache-Control" : "no-store", - "Accept-Ranges" : "none", - "Date" : "Thu, 14 May 2015 07:55:18 GMT", - "x-frame-options" : "SAMEORIGIN", - "alternate-protocol" : "443:quic,p=1", + "alt-svc" : "quic=\":443\"; ma=2592000; v=\"36,35,34,33,32\"", + "Content-Encoding" : "gzip", + "Server" : "YouTubeFrontEnd", "x-xss-protection" : "1; mode=block; report=https:\/\/www.google.com\/appserve\/security-bugs\/log\/youtube", "Expires" : "Tue, 27 Apr 1971 19:44:06 EST", - "Vary" : "Accept-Encoding" + "Cache-Control" : "no-store", + "Date" : "Thu, 13 Oct 2016 01:41:25 GMT", + "Content-Length" : "138", + "Strict-Transport-Security" : "max-age=31536000", + "x-content-type-options" : "nosniff", + "x-frame-options" : "SAMEORIGIN" }, "method" : "GET", "status" : 200, "uri" : "https:\/\/www.youtube.com\/get_video_info?el=detailpage&hl=en&ps=default&video_id=1kIsylLeHHU" }, { - "body" : "c=WEB&reason=This+video+contains+content+from+Youtube+test+content+owner%2C+who+has+blocked+it+on+copyright+grounds.&status=fail&errordetail=0&eventid=5lRUVeKpCpW_cOzZgOgD&csi_page_type=embed&atc=a%3D3%26b%3DuLaKBiGpKZ4EItjiibzNb6qZTuU%26c%3D1431590118%26d%3D1%26e%3D1kIsylLeHHU%26c3a%3D25%26hh%3DDLk59Mx5mCQS38XEMToWRGSyEI0&enablecsi=1&errorcode=150", + "body" : "errorcode=150&status=fail&c=WEB&atc=a%3D3%26b%3DDfCHg4ByfZ0JYJyCAYR0JrhokmY%26c%3D1476322885%26d%3D1%26e%3D1kIsylLeHHU%26c3a%3D26%26hh%3D9sZhlMfys4Co7lZkDBiYI1j7ALQ&errordetail=0&cver=1.20161011&csi_page_type=embed&reason=This+video+contains+content+from+Youtube+test+content+owner%2C+who+has+blocked+it+on+copyright+grounds.&enablecsi=1&eventid=Reb-V9CHD8_KWZCSrLgF", "headers" : { - "x-content-type-options" : "nosniff", "Content-Type" : "application\/x-www-form-urlencoded", - "Server" : "gwiseguy\/2.0", - "Cache-Control" : "no-store", - "Accept-Ranges" : "none", - "Date" : "Thu, 14 May 2015 07:55:18 GMT", - "x-frame-options" : "SAMEORIGIN", - "alternate-protocol" : "443:quic,p=1", + "p3p" : "CP=\"This is not a P3P policy! See http:\/\/support.google.com\/accounts\/answer\/151657?hl=en for more info.\"", + "alt-svc" : "quic=\":443\"; ma=2592000; v=\"36,35,34,33,32\"", + "Set-Cookie" : "YSC=GFwb8QAOck0; path=\/; domain=.youtube.com; httponly", + "Server" : "YouTubeFrontEnd", + "Content-Encoding" : "gzip", "x-xss-protection" : "1; mode=block; report=https:\/\/www.google.com\/appserve\/security-bugs\/log\/youtube", "Expires" : "Tue, 27 Apr 1971 19:44:06 EST", - "Vary" : "Accept-Encoding" + "Cache-Control" : "no-store", + "Date" : "Thu, 13 Oct 2016 01:41:25 GMT", + "Strict-Transport-Security" : "max-age=31536000", + "Content-Length" : "303", + "x-content-type-options" : "nosniff", + "x-frame-options" : "SAMEORIGIN" }, "method" : "GET", "status" : 200, "uri" : "https:\/\/www.youtube.com\/get_video_info?el=embedded&hl=en&ps=default&video_id=1kIsylLeHHU" }, { - "body" : "(function(){var f,aa=aa||{},m=this;function n(a){return void 0!==a}function q(a,b,c){a=a.split(\".\");c=c||m;a[0]in c||!c.execScript||c.execScript(\"var \"+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&n(b)?c[d]=b:c[d]?c=c[d]:c=c[d]={}}function u(a,b){for(var c=a.split(\".\"),d=b||m,e;e=c.shift();)if(null!=d[e])d=d[e];else return null;return d}function v(){}function ba(a){a.getInstance=function(){return a.Jb?a.Jb:a.Jb=new a}}\nfunction ca(a){var b=typeof a;if(\"object\"==b)if(a){if(a instanceof Array)return\"array\";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(\"[object Window]\"==c)return\"object\";if(\"[object Array]\"==c||\"number\"==typeof a.length&&\"undefined\"!=typeof a.splice&&\"undefined\"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable(\"splice\"))return\"array\";if(\"[object Function]\"==c||\"undefined\"!=typeof a.call&&\"undefined\"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable(\"call\"))return\"function\"}else return\"null\";\nelse if(\"function\"==b&&\"undefined\"==typeof a.call)return\"object\";return b}function da(a){return null===a}function ea(a){return\"array\"==ca(a)}function fa(a){var b=ca(a);return\"array\"==b||\"object\"==b&&\"number\"==typeof a.length}function x(a){return\"string\"==typeof a}function ga(a){return\"number\"==typeof a}function ha(a){return\"function\"==ca(a)}function ia(a){var b=typeof a;return\"object\"==b&&null!=a||\"function\"==b}function ja(a){return a[ka]||(a[ka]=++la)}\nvar ka=\"closure_uid_\"+(1E9*Math.random()>>>0),la=0;function ma(a,b,c){return a.call.apply(a.bind,arguments)}function na(a,b,c){if(!a)throw Error();if(2\")&&(a=a.replace(Da,\">\"));-1!=a.indexOf('\"')&&(a=a.replace(Ea,\""\"));-1!=a.indexOf(\"'\")&&(a=a.replace(Fa,\"'\"));-1!=a.indexOf(\"\\x00\")&&(a=a.replace(Ga,\"�\"));return a}var Aa=\/&\/g,Ba=\/<\/g,Da=\/>\/g,Ea=\/\"\/g,Fa=\/'\/g,Ga=\/\\x00\/g,za=\/[\\x00&<>\"']\/;function Ha(a){return-1!=a.indexOf(\"&\")?\"document\"in m?Ia(a):Ka(a):a}\nfunction Ia(a){var b={\"&\":\"&\",\"<\":\"<\",\">\":\">\",\""\":'\"'},c;c=m.document.createElement(\"div\");return a.replace(La,function(a,e){var g=b[a];if(g)return g;if(\"#\"==e.charAt(0)){var h=Number(\"0\"+e.substr(1));isNaN(h)||(g=String.fromCharCode(h))}g||(c.innerHTML=a+\" \",g=c.firstChild.nodeValue.slice(0,-1));return b[a]=g})}\nfunction Ka(a){return a.replace(\/&([^;]+);\/g,function(a,c){switch(c){case \"amp\":return\"&\";case \"lt\":return\"<\";case \"gt\":return\">\";case \"quot\":return'\"';default:if(\"#\"==c.charAt(0)){var d=Number(\"0\"+c.substr(1));if(!isNaN(d))return String.fromCharCode(d)}return a}})}var La=\/&([^;\\s<&]+);?\/g;function Ma(a,b){a.length>b&&(a=a.substring(0,b-3)+\"...\");return a}var Na={\"\\x00\":\"\\\\0\",\"\\b\":\"\\\\b\",\"\\f\":\"\\\\f\",\"\\n\":\"\\\\n\",\"\\r\":\"\\\\r\",\"\\t\":\"\\\\t\",\"\\x0B\":\"\\\\x0B\",'\"':'\\\\\"',\"\\\\\":\"\\\\\\\\\"},Oa={\"'\":\"\\\\'\"};\nfunction Pa(a,b){return-1!=a.toLowerCase().indexOf(b.toLowerCase())}function Qa(){var a;a=\"\";var b=qa(\"Skip Ad \\u00bb\");a=a+b;b=new RegExp(Ra(\"\\u00bb\"),\"\");return a.replace(b,\"\")}function Ra(a){return String(a).replace(\/([-()\\[\\]{}+?*.$\\^|,:#b?1:0}\nfunction Xa(a){for(var b=0,c=0;cc?Math.max(0,a.length+c):c;if(x(a))return x(b)&&1==b.length?a.indexOf(b,c):-1;for(;cc&&(c=Math.max(0,a.length+c));if(x(a))return x(b)&&1==b.length?a.lastIndexOf(b,c):-1;for(;0<=c;c--)if(c in a&&a[c]===b)return c;\nreturn-1},D=hb.forEach?function(a,b,c){hb.forEach.call(a,b,c)}:function(a,b,c){for(var d=a.length,e=x(a)?a.split(\"\"):a,g=0;gb?null:x(a)?a.charAt(b):a[b]}function ob(a,b,c){for(var d=a.length,e=x(a)?a.split(\"\"):a,g=0;gc?null:x(a)?a.charAt(c):a[c]}function qb(a,b,c){for(var d=x(a)?a.split(\"\"):a,e=a.length-1;0<=e;e--)if(e in d&&b.call(c,d[e],e,a))return e;return-1}function G(a,b){return 0<=ib(a,b)}function rb(a){return 0==a.length}\nfunction sb(a){if(!ea(a))for(var b=a.length-1;0<=b;b--)delete a[b];a.length=0}function tb(a,b){G(a,b)||a.push(b)}function ub(a,b){var c=ib(a,b),d;(d=0<=c)&&vb(a,c);return d}function vb(a,b){hb.splice.call(a,b,1)}function wb(a,b){var c=ob(a,b,void 0);0<=c&&vb(a,c)}function xb(a){return hb.concat.apply(hb,arguments)}function yb(a){var b=a.length;if(0=arguments.length?hb.slice.call(a,b):hb.slice.call(a,b,c)}\nfunction Cb(a,b,c){b=b||a;c=c||function(){return ia(h)?\"o\"+ja(h):(typeof h).charAt(0)+h};for(var d={},e=0,g=0;g>1,k;k=c(b,a[h]);0b?1:ac&&Ab(a,-(c+1),0,b)}function Lb(a){for(var b=[],c=0;c]*>|&[^;]+;\/g;function mc(a,b){return b?a.replace(lc,\"\"):a}\nvar nc=RegExp(\"[\\u0591-\\u06ef\\u06fa-\\u07ff\\u200f\\ufb1d-\\ufdff\\ufe70-\\ufefc]\"),oc=RegExp(\"[A-Za-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u02b8\\u0300-\\u0590\\u0800-\\u1fff\\u200e\\u2c00-\\ufb1c\\ufe00-\\ufe6f\\ufefd-\\uffff]\"),pc=RegExp(\"^[^A-Za-z\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u02b8\\u0300-\\u0590\\u0800-\\u1fff\\u200e\\u2c00-\\ufb1c\\ufe00-\\ufe6f\\ufefd-\\uffff]*[\\u0591-\\u06ef\\u06fa-\\u07ff\\u200f\\ufb1d-\\ufdff\\ufe70-\\ufefc]\"),qc=\/^http:\\\/\\\/.*\/,rc=\/^(ar|ckb|dv|he|iw|fa|nqo|ps|sd|ug|ur|yi|.*[-_](Arab|Hebr|Thaa|Nkoo|Tfng))(?!.*[-_](Latn|Cyrl)($|-|_))($|-|_)\/i,sc=\n\/\\s+\/,tc=\/[\\d\\u06f0-\\u06f9]\/;function uc(){this.j=\"\";this.o=vc}uc.prototype.Ve=!0;uc.prototype.Yd=function(){return this.j};uc.prototype.toString=function(){return\"Const{\"+this.j+\"}\"};function wc(a){return a instanceof uc&&a.constructor===uc&&a.o===vc?a.j:\"type_error:Const\"}var vc={};function xc(a){var b=new uc;b.j=a;return b};function yc(){this.j=\"\";this.o=zc}yc.prototype.Ve=!0;var zc={};yc.prototype.Yd=function(){return this.j};function Ac(a){var b=new yc;b.j=a;return b}var Bc=Ac(\"\"),Cc=\/^[-,.\"'%_!# a-zA-Z0-9]+$\/;function Dc(){this.j=\"\";this.o=Ec}Dc.prototype.Ve=!0;Dc.prototype.Yd=function(){return this.j};Dc.prototype.Ll=!0;Dc.prototype.zf=function(){return 1};function Fc(a){return a instanceof Dc&&a.constructor===Dc&&a.o===Ec?a.j:\"type_error:SafeUrl\"}var Gc=\/^(?:(?:https?|mailto|ftp):|[^&:\/?#]*(?:[\/?#]|$))\/i;function Hc(a){if(a instanceof Dc)return a;a=a.Ve?a.Yd():String(a);a=Gc.test(a)?Ic(a):\"about:invalid#zClosurez\";var b=new Dc;b.j=a;return b}\nfunction Ic(a){try{var b=encodeURI(a)}catch(c){return\"about:invalid#zClosurez\"}return b.replace(Jc,function(a){return Kc[a]})}var Jc=\/[()']|%5B|%5D|%25\/g,Kc={\"'\":\"%27\",\"(\":\"%28\",\")\":\"%29\",\"%5B\":\"[\",\"%5D\":\"]\",\"%25\":\"%\"},Ec={};function Lc(){this.j=Mc}Lc.prototype.Ve=!0;Lc.prototype.Yd=function(){return\"\"};Lc.prototype.Ll=!0;Lc.prototype.zf=function(){return 1};var Mc={};function Nc(){this.j=\"\";this.A=Oc;this.o=null}Nc.prototype.Ll=!0;Nc.prototype.zf=function(){return this.o};Nc.prototype.Ve=!0;Nc.prototype.Yd=function(){return this.j};function Pc(a){return a instanceof Nc&&a.constructor===Nc&&a.A===Oc?a.j:\"type_error:SafeHtml\"}var Qc=\/^[a-zA-Z0-9-]+$\/,Rc={action:!0,cite:!0,data:!0,formaction:!0,href:!0,manifest:!0,poster:!0,src:!0},Sc={EMBED:!0,IFRAME:!0,LINK:!0,OBJECT:!0,SCRIPT:!0,STYLE:!0,TEMPLATE:!0};\nfunction Tc(a){function b(a){if(ea(a))D(a,b);else{var g;a instanceof Nc?g=a:(g=null,a.Ll&&(g=a.zf()),a=ya(a.Ve?a.Yd():String(a)),g=Uc(a,g));d+=Pc(g);g=g.zf();0==c?c=g:0!=g&&c!=g&&(c=null)}}var c=0,d=\"\";D(arguments,b);return Uc(d,c)}var Oc={};function Uc(a,b){var c=new Nc;c.j=a;c.o=b;return c}Uc(\"\",0);Uc(\"\",0);function Vc(a,b,c){return Math.min(Math.max(a,b),c)};function Wc(a,b){this.x=n(a)?a:0;this.y=n(b)?b:0}f=Wc.prototype;f.clone=function(){return new Wc(this.x,this.y)};function Xc(a,b){return a==b?!0:a&&b?a.x==b.x&&a.y==b.y:!1}function Yc(a,b){return new Wc(a.x-b.x,a.y-b.y)}f.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};f.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};f.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};\nf.scale=function(a,b){var c=ga(b)?b:a;this.x*=a;this.y*=c;return this};function H(a,b){this.width=a;this.height=b}function Zc(a,b){return a==b?!0:a&&b?a.width==b.width&&a.height==b.height:!1}f=H.prototype;f.clone=function(){return new H(this.width,this.height)};f.isEmpty=function(){return!(this.width*this.height)};f.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};\nf.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};f.scale=function(a,b){var c=ga(b)?b:a;this.width*=a;this.height*=c;return this};var $c;a:{var ad=m.navigator;if(ad){var bd=ad.userAgent;if(bd){$c=bd;break a}}$c=\"\"}function cd(a){return-1!=$c.indexOf(a)};function dd(){return cd(\"Opera\")||cd(\"OPR\")}function ed(){return cd(\"Edge\")||cd(\"Trident\")||cd(\"MSIE\")}function fd(){return(cd(\"Chrome\")||cd(\"CriOS\"))&&!dd()&&!ed()};function gd(){return cd(\"Edge\")};function hd(){return cd(\"iPhone\")&&!cd(\"iPod\")&&!cd(\"iPad\")};var id=dd(),jd=ed(),kd=cd(\"Gecko\")&&!(Pa($c,\"WebKit\")&&!gd())&&!(cd(\"Trident\")||cd(\"MSIE\"))&&!gd(),ld=Pa($c,\"WebKit\")&&!gd(),md=ld&&cd(\"Mobile\"),nd=cd(\"Macintosh\"),od=cd(\"Windows\"),pd=cd(\"Linux\")||cd(\"CrOS\"),qd=cd(\"Android\"),rd=hd(),td=cd(\"iPad\");function ud(){var a=$c;if(kd)return\/rv\\:([^\\);]+)(\\)|;)\/.exec(a);if(jd&&gd())return\/Edge\\\/([\\d\\.]+)\/.exec(a);if(jd)return\/\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)\/.exec(a);if(ld)return\/WebKit\\\/(\\S+)\/.exec(a)}\nfunction vd(){var a=m.document;return a?a.documentMode:void 0}var wd=function(){if(id&&m.opera){var a=m.opera.version;return ha(a)?a():a}var a=\"\",b=ud();b&&(a=b?b[1]:\"\");return jd&&!gd()&&(b=vd(),b>parseFloat(a))?String(b):a}(),xd={};function yd(a){return xd[a]||(xd[a]=0<=Va(wd,a))}function zd(a){return jd&&(gd()||Ad>=a)}var Bd=m.document,Cd=vd(),Ad=!Bd||!jd||!Cd&&gd()?void 0:Cd||(\"CSS1Compat\"==Bd.compatMode?parseInt(wd,10):5);var Dd=!jd||zd(9),Ed=!kd&&!jd||jd&&zd(9)||kd&&yd(\"1.9.1\"),Fd=jd&&!yd(\"9\"),Gd=jd||id||ld;function Hd(a){return a?new Id(Jd(a)):sa||(sa=new Id)}function Kd(a){return x(a)?document.getElementById(a):a}function Ld(a,b){var c=b||document;return c.querySelectorAll&&c.querySelector?c.querySelectorAll(\".\"+a):Md(\"*\",a,b)}function Nd(a,b){var c=b||document,d=null;c.getElementsByClassName?d=c.getElementsByClassName(a)[0]:c.querySelectorAll&&c.querySelector?d=c.querySelector(\".\"+a):d=Md(\"*\",a,b)[0];return d||null}\nfunction Md(a,b,c){var d=document;c=c||d;a=a&&\"*\"!=a?a.toUpperCase():\"\";if(c.querySelectorAll&&c.querySelector&&(a||b))return c.querySelectorAll(a+(b?\".\"+b:\"\"));if(b&&c.getElementsByClassName){c=c.getElementsByClassName(b);if(a){for(var d={},e=0,g=0,h;h=c[g];g++)a==h.nodeName&&(d[e++]=h);d.length=e;return d}return c}c=c.getElementsByTagName(a||\"*\");if(b){d={};for(g=e=0;h=c[g];g++)a=h.className,\"function\"==typeof a.split&&G(a.split(\/\\s+\/),b)&&(d[e++]=h);d.length=e;return d}return c}\nfunction Od(a,b){Nb(b,function(b,d){\"style\"==d?a.style.cssText=b:\"class\"==d?a.className=b:\"for\"==d?a.htmlFor=b:d in Pd?a.setAttribute(Pd[d],b):ta(d,\"aria-\")||ta(d,\"data-\")?a.setAttribute(d,b):a[d]=b})}var Pd={cellpadding:\"cellPadding\",cellspacing:\"cellSpacing\",colspan:\"colSpan\",frameborder:\"frameBorder\",height:\"height\",maxlength:\"maxLength\",role:\"role\",rowspan:\"rowSpan\",type:\"type\",usemap:\"useMap\",valign:\"vAlign\",width:\"width\"};\nfunction Qd(a){a=a.document;a=\"CSS1Compat\"==a.compatMode?a.documentElement:a.body;return new H(a.clientWidth,a.clientHeight)}function Rd(a){var b=Sd(a);a=a.parentWindow||a.defaultView;return jd&&yd(\"10\")&&a.pageYOffset!=b.scrollTop?new Wc(b.scrollLeft,b.scrollTop):new Wc(a.pageXOffset||b.scrollLeft,a.pageYOffset||b.scrollTop)}function Sd(a){return ld||\"CSS1Compat\"!=a.compatMode?a.body||a.documentElement:a.documentElement}function Td(a){return a?a.parentWindow||a.defaultView:window}\nfunction I(a,b,c){return Ud(document,arguments)}function Ud(a,b){var c=b[0],d=b[1];if(!Dd&&d&&(d.name||d.type)){c=[\"<\",c];d.name&&c.push(' name=\"',ya(d.name),'\"');if(d.type){c.push(' type=\"',ya(d.type),'\"');var e={};gc(e,d);delete e.type;d=e}c.push(\">\");c=c.join(\"\")}c=a.createElement(c);d&&(x(d)?c.className=d:ea(d)?c.className=d.join(\" \"):Od(c,d));2a}\nfunction se(a){if(Fd&&\"innerText\"in a)a=a.innerText.replace(\/(\\r\\n|\\r|\\n)\/g,\"\\n\");else{var b=[];te(a,b,!0);a=b.join(\"\")}a=a.replace(\/ \\xAD \/g,\" \").replace(\/\\xAD\/g,\"\");a=a.replace(\/\\u200B\/g,\"\");Fd||(a=a.replace(\/ +\/g,\" \"));\" \"!=a&&(a=a.replace(\/^\\s*\/,\"\"));return a}\nfunction te(a,b,c){if(!(a.nodeName in ne))if(3==a.nodeType)c?b.push(String(a.nodeValue).replace(\/(\\r\\n|\\r|\\n)\/g,\"\")):b.push(a.nodeValue);else if(a.nodeName in oe)b.push(oe[a.nodeName]);else for(a=a.firstChild;a;)te(a,b,c),a=a.nextSibling}function Wd(a){if(a&&\"number\"==typeof a.length){if(ia(a))return\"function\"==typeof a.item||\"string\"==typeof a.item;if(ha(a))return\"function\"==typeof a.item}return!1}\nfunction ue(a,b){return b?ve(a,function(a){return!b||x(a.className)&&G(a.className.split(\/\\s+\/),b)},!0,void 0):null}function ve(a,b,c,d){c||(a=a.parentNode);c=null==d;for(var e=0;a&&(c||e<=d);){if(b(a))return a;a=a.parentNode;e++}return null}function Id(a){this.j=a||m.document||document}f=Id.prototype;f.R=function(a){return x(a)?this.j.getElementById(a):a};f.sw=function(a,b,c){return Ud(this.j,arguments)};f.createElement=function(a){return this.j.createElement(a)};\nfunction we(a){return\"CSS1Compat\"==a.j.compatMode}function xe(a){a=a.j;return a.parentWindow||a.defaultView}function ye(a){return Rd(a.j)}f.appendChild=Zd;f.append=$d;f.contains=ie;var ze=\"StopIteration\"in m?m.StopIteration:{message:\"StopIteration\",stack:\"\"};function Ae(){}Ae.prototype.next=function(){throw ze;};Ae.prototype.Xb=function(){return this};function Be(a){if(a instanceof Ae)return a;if(\"function\"==typeof a.Xb)return a.Xb(!1);if(fa(a)){var b=0,c=new Ae;c.next=function(){for(;;){if(b>=a.length)throw ze;if(b in a)return a[b++];b++}};return c}throw Error(\"Not implemented\");}\nfunction Ce(a,b,c){if(fa(a))try{D(a,b,c)}catch(d){if(d!==ze)throw d;}else{a=Be(a);try{for(;;)b.call(c,a.next(),void 0,a)}catch(e){if(e!==ze)throw e;}}}function De(a){if(fa(a))return yb(a);a=Be(a);var b=[];Ce(a,function(a){b.push(a)});return b};function Ee(a,b){this.o={};this.j=[];this.ne=this.qa=0;var c=arguments.length;if(12*this.qa&&Fe(this),!0):!1};function Fe(a){if(a.qa!=a.j.length){for(var b=0,c=0;b=d.j.length)throw ze;var e=d.j[b++];return a?e:d.o[e]};return e};function He(a,b){return Object.prototype.hasOwnProperty.call(a,b)};function Je(a){return\"function\"==typeof a.Za?a.Za():fa(a)||x(a)?a.length:Sb(a)}function Ke(a){if(\"function\"==typeof a.Qa)return a.Qa();if(x(a))return a.split(\"\");if(fa(a)){for(var b=[],c=a.length,d=0;dc?a[1]=\"?\":c==b.length-1&&(a[1]=void 0)}return a.join(\"\")}function Xe(a,b,c){if(ea(b))for(var d=0;dd)return null;var e=a.indexOf(\"&\",d);if(0>e||e>c)e=c;d+=b.length+1;return xa(a.substr(d,e-d))}var ff=\/[?&]($|#)\/;\nfunction gf(a,b,c){for(var d=a.search(df),e=0,g,h=[];0<=(g=cf(a,e,b,d));)h.push(a.substring(e,g)),e=Math.min(a.indexOf(\"&\",g)+1||d,d);h.push(a.substr(e));a=[h.join(\"\").replace(ff,\"$1\"),\"&\",b];null!=c&&a.push(\"=\",wa(c));return We(a)};function J(a,b){this.o=this.G=this.B=\"\";this.C=null;this.H=this.A=\"\";this.D=!1;var c;a instanceof J?(this.D=n(b)?b:a.D,hf(this,a.B),this.G=a.G,jf(this,a.o),kf(this,a.C),lf(this,a.A),mf(this,a.j.clone()),this.H=a.Af()):a&&(c=Qe(String(a)))?(this.D=!!b,hf(this,c[1]||\"\",!0),this.G=nf(c[2]||\"\"),jf(this,c[3]||\"\",!0),kf(this,c[4]),lf(this,c[5]||\"\",!0),mf(this,c[6]||\"\",!0),this.H=nf(c[7]||\"\")):(this.D=!!b,this.j=new of(null,0,this.D))}f=J.prototype;\nf.toString=function(){var a=[],b=this.B;b&&a.push(pf(b,qf,!0),\":\");if(b=this.o){a.push(\"\/\/\");var c=this.G;c&&a.push(pf(c,qf,!0),\"@\");a.push(wa(b).replace(\/%25([0-9a-fA-F]{2})\/g,\"%$1\"));b=this.C;null!=b&&a.push(\":\",String(b))}if(b=this.A)this.o&&\"\/\"!=b.charAt(0)&&a.push(\"\/\"),a.push(pf(b,\"\/\"==b.charAt(0)?rf:sf,!0));(b=this.j.toString())&&a.push(\"?\",b);(b=this.Af())&&a.push(\"#\",pf(b,tf));return a.join(\"\")};\nf.resolve=function(a){var b=this.clone(),c=!!a.B;c?hf(b,a.B):c=!!a.G;c?b.G=a.G:c=!!a.o;c?jf(b,a.o):c=null!=a.C;var d=a.A;if(c)kf(b,a.C);else if(c=!!a.A){if(\"\/\"!=d.charAt(0))if(this.o&&!this.A)d=\"\/\"+d;else{var e=b.A.lastIndexOf(\"\/\");-1!=e&&(d=b.A.substr(0,e+1)+d)}e=d;if(\"..\"==e||\".\"==e)d=\"\";else if(-1!=e.indexOf(\".\/\")||-1!=e.indexOf(\"\/.\")){for(var d=ta(e,\"\/\"),e=e.split(\"\/\"),g=[],h=0;hb)throw Error(\"Bad port number \"+b);a.C=b}else a.C=null;return a}function lf(a,b,c){a.A=c?nf(b,!0):b}\nfunction mf(a,b,c){b instanceof of?(a.j=b,vf(a.j,a.D)):(c||(b=pf(b,wf)),a.j=new of(b,0,a.D));return a}function xf(a){return a.j}f.Go=function(){return this.j.toString()};function K(a,b,c){a.j.set(b,c);return a}function yf(a,b,c){ea(c)||(c=[String(c)]);zf(a.j,b,c)}f.Af=function(){return this.H};function Af(a){K(a,\"zx\",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^z()).toString(36));return a}\nfunction Bf(a){return a instanceof J?a.clone():new J(a,void 0)}function Cf(a,b,c,d){var e=new J(null,void 0);a&&hf(e,a);b&&jf(e,b);c&&kf(e,c);d&&lf(e,d);return e}function nf(a,b){return a?b?decodeURI(a.replace(\/%25\/g,\"%2525\")):decodeURIComponent(a):\"\"}function pf(a,b,c){return x(a)?(a=encodeURI(a).replace(b,Df),c&&(a=a.replace(\/%25([0-9a-fA-F]{2})\/g,\"%$1\")),a):null}function Df(a){a=a.charCodeAt(0);return\"%\"+(a>>4&15).toString(16)+(a&15).toString(16)}\nvar qf=\/[#\\\/\\?@]\/g,sf=\/[\\#\\?:]\/g,rf=\/[\\#\\?]\/g,wf=\/[\\#\\?@]\/g,tf=\/#\/g;function of(a,b,c){this.qa=this.j=null;this.o=a||null;this.A=!!c}function Ef(a){a.j||(a.j=new Ee,a.qa=0,a.o&&Ve(a.o,function(b,c){a.add(xa(b),c)}))}f=of.prototype;f.Za=function(){Ef(this);return this.qa};f.add=function(a,b){Ef(this);this.o=null;a=Ff(this,a);var c=this.j.get(a);c||this.j.set(a,c=[]);c.push(b);this.qa++;return this};\nf.remove=function(a){Ef(this);a=Ff(this,a);return Ge(this.j,a)?(this.o=null,this.qa-=this.j.get(a).length,this.j.remove(a)):!1};f.clear=function(){this.j=this.o=null;this.qa=0};f.isEmpty=function(){Ef(this);return 0==this.qa};function Gf(a,b){Ef(a);b=Ff(a,b);return Ge(a.j,b)}f.vf=function(a){var b=this.Qa();return G(b,a)};f.Na=function(){Ef(this);for(var a=this.j.Qa(),b=this.j.Na(),c=[],d=0;dMath.random()&&bg(a,\"WARNING\"));return b||c}function jg(a){return!!a&&-1!=a.search(Mf)}\nfunction kg(a){return!!a&&-1!=a.search(Rf)}function lg(a){a=new J(a);hf(a,document.location.protocol);jf(a,document.location.hostname);document.location.port&&kf(a,document.location.port);return a.toString()}function mg(a){a=new J(a);hf(a,document.location.protocol);return a.toString()};var ng={},og=0,pg=u(\"yt.net.ping.workerUrl_\")||null;q(\"yt.net.ping.workerUrl_\",pg,void 0);function qg(a,b,c){a&&(c?a&&(a=I(\"iframe\",{src:'javascript:\"data:text\/html,<\/body>\"',style:\"display:none\"}),Jd(a).body.appendChild(a)):rg(a,b))}function rg(a,b){var c=new Image,d=\"\"+og++;ng[d]=c;c.onload=c.onerror=function(){b&&ng[d]&&b();delete ng[d]};c.src=a;c=eval(\"null\")};function sg(a){if(a.classList)return a.classList;a=a.className;return x(a)&&a.match(\/\\S+\/g)||[]}function tg(a,b){return a.classList?a.classList.contains(b):G(sg(a),b)}function N(a,b){a.classList?a.classList.add(b):tg(a,b)||(a.className+=0=this.left&&a.right<=this.right&&a.top>=this.top&&a.bottom<=this.bottom:a.x>=this.left&&a.x<=this.right&&a.y>=this.top&&a.y<=this.bottom:!1};\nf.ceil=function(){this.top=Math.ceil(this.top);this.right=Math.ceil(this.right);this.bottom=Math.ceil(this.bottom);this.left=Math.ceil(this.left);return this};f.floor=function(){this.top=Math.floor(this.top);this.right=Math.floor(this.right);this.bottom=Math.floor(this.bottom);this.left=Math.floor(this.left);return this};f.round=function(){this.top=Math.round(this.top);this.right=Math.round(this.right);this.bottom=Math.round(this.bottom);this.left=Math.round(this.left);return this};\nf.scale=function(a,b){var c=ga(b)?b:a;this.left*=a;this.right*=a;this.top*=c;this.bottom*=c;return this};function Ig(a,b,c,d){this.left=a;this.top=b;this.width=c;this.height=d}f=Ig.prototype;f.clone=function(){return new Ig(this.left,this.top,this.width,this.height)};function Jg(a){return new Hg(a.top,a.left+a.width,a.top+a.height,a.left)}function Kg(a){return new Ig(a.left,a.top,a.right-a.left,a.bottom-a.top)}function Lg(a,b){return a==b?!0:a&&b?a.left==b.left&&a.width==b.width&&a.top==b.top&&a.height==b.height:!1}\nfunction Mg(a,b){var c=Math.max(a.left,b.left),d=Math.min(a.left+a.width,b.left+b.width);if(c<=d){var e=Math.max(a.top,b.top),g=Math.min(a.top+a.height,b.top+b.height);if(e<=g)return a.left=c,a.top=e,a.width=d-c,a.height=g-e,!0}return!1}f.contains=function(a){return a instanceof Ig?this.left<=a.left&&this.left+this.width>=a.left+a.width&&this.top<=a.top&&this.top+this.height>=a.top+a.height:a.x>=this.left&&a.x<=this.left+this.width&&a.y>=this.top&&a.y<=this.top+this.height};\nfunction Ng(a){return new H(a.width,a.height)}function Og(a){return new Wc(a.left,a.top)}f.ceil=function(){this.left=Math.ceil(this.left);this.top=Math.ceil(this.top);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};f.floor=function(){this.left=Math.floor(this.left);this.top=Math.floor(this.top);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};\nf.round=function(){this.left=Math.round(this.left);this.top=Math.round(this.top);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};f.scale=function(a,b){var c=ga(b)?b:a;this.left*=a;this.width*=a;this.top*=c;this.height*=c;return this};function Pg(a){Pg[\" \"](a);return a}Pg[\" \"]=v;function Qg(a,b){try{return Pg(a[b]),!0}catch(c){}return!1};function Rg(){return ld?\"Webkit\":kd?\"Moz\":jd?\"ms\":id?\"O\":null};function Sg(a,b,c){if(x(b))(b=Tg(a,b))&&(a.style[b]=c);else for(var d in b){c=a;var e=b[d],g=Tg(c,d);g&&(c.style[g]=e)}}var Ug={};function Tg(a,b){var c=Ug[b];if(!c){var d=ab(b),c=d;void 0===a.style[d]&&(d=Rg()+bb(d),void 0!==a.style[d]&&(c=d));Ug[b]=c}return c}function Vg(a,b){var c=a.style[ab(b)];return\"undefined\"!==typeof c?c:a.style[Tg(a,b)]||\"\"}\nfunction Wg(a,b){var c=Jd(a);return c.defaultView&&c.defaultView.getComputedStyle&&(c=c.defaultView.getComputedStyle(a,null))?c[b]||c.getPropertyValue(b)||\"\":\"\"}function Xg(a,b){return Wg(a,b)||(a.currentStyle?a.currentStyle[b]:null)||a.style&&a.style[b]}function Yg(a,b,c){var d;b instanceof Wc?(d=b.x,b=b.y):(d=b,b=c);a.style.left=Zg(d,!1);a.style.top=Zg(b,!1)}function $g(a){return new Wc(a.offsetLeft,a.offsetTop)}\nfunction ah(a){var b;try{b=a.getBoundingClientRect()}catch(c){return{left:0,top:0,right:0,bottom:0}}jd&&a.ownerDocument.body&&(a=a.ownerDocument,b.left-=a.documentElement.clientLeft+a.body.clientLeft,b.top-=a.documentElement.clientTop+a.body.clientTop);return b}\nfunction bh(a){if(jd&&!zd(8))return a.offsetParent;var b=Jd(a),c=Xg(a,\"position\"),d=\"fixed\"==c||\"absolute\"==c;for(a=a.parentNode;a&&a!=b;a=a.parentNode)if(11==a.nodeType&&a.host&&(a=a.host),c=Xg(a,\"position\"),d=d&&\"static\"==c&&a!=b.documentElement&&a!=b.body,!d&&(a.scrollWidth>a.clientWidth||a.scrollHeight>a.clientHeight||\"fixed\"==c||\"absolute\"==c||\"relative\"==c))return a;return null}\nfunction ch(a){for(var b=new Hg(0,Infinity,Infinity,0),c=Hd(a),d=c.j.body,e=c.j.documentElement,g=Sd(c.j);a=bh(a);)if(!(jd&&0==a.clientWidth||ld&&0==a.clientHeight&&a==d)&&a!=d&&a!=e&&\"visible\"!=Xg(a,\"overflow\")){var h=dh(a),k=new Wc(a.clientLeft,a.clientTop);h.x+=k.x;h.y+=k.y;b.top=Math.max(b.top,h.y);b.right=Math.min(b.right,h.x+a.clientWidth);b.bottom=Math.min(b.bottom,h.y+a.clientHeight);b.left=Math.max(b.left,h.x)}d=g.scrollLeft;g=g.scrollTop;b.left=Math.max(b.left,d);b.top=Math.max(b.top,g);\nc=Qd(xe(c)||window);b.right=Math.min(b.right,d+c.width);b.bottom=Math.min(b.bottom,g+c.height);return 0<=b.top&&0<=b.left&&b.bottom>b.top&&b.right>b.left?b:null}function dh(a){var b=Jd(a),c=new Wc(0,0),d;d=b?Jd(b):document;d=!jd||zd(9)||we(Hd(d))?d.documentElement:d.body;if(a==d)return c;a=ah(a);b=ye(Hd(b));c.x=a.left+b.x;c.y=a.top+b.y;return c}\nfunction eh(a,b){var c=new Wc(0,0),d=Td(Jd(a)),e=a;do{var g=d==b?dh(e):fh(e);c.x+=g.x;c.y+=g.y}while(d&&d!=b&&d!=d.parent&&(e=d.frameElement)&&(d=d.parent));return c}function fh(a){a=ah(a);return new Wc(a.left,a.top)}function hh(a){if(1==a.nodeType)return fh(a);var b=ha(a.F),c=a;a.targetTouches&&a.targetTouches.length?c=a.targetTouches[0]:b&&a.j.targetTouches&&a.j.targetTouches.length&&(c=a.j.targetTouches[0]);return new Wc(c.clientX,c.clientY)}\nfunction ih(a,b,c){if(b instanceof H)c=b.height,b=b.width;else if(void 0==c)throw Error(\"missing height argument\");jh(a,b);a.style.height=Zg(c,!0)}function Zg(a,b){\"number\"==typeof a&&(a=(b?Math.round(a):a)+\"px\");return a}function jh(a,b){a.style.width=Zg(b,!0)}function kh(a){return lh(a)}\nfunction lh(a){var b=mh;if(\"none\"!=Xg(a,\"display\"))return b(a);var c=a.style,d=c.display,e=c.visibility,g=c.position;c.visibility=\"hidden\";c.position=\"absolute\";c.display=\"inline\";a=b(a);c.display=d;c.position=g;c.visibility=e;return a}function mh(a){var b=a.offsetWidth,c=a.offsetHeight,d=ld&&!b&&!c;return n(b)&&!d||!a.getBoundingClientRect?new H(b,c):(a=ah(a),new H(a.right-a.left,a.bottom-a.top))}function nh(a){var b=dh(a);a=lh(a);return new Ig(b.x,b.y,a.width,a.height)}\nfunction oh(a,b){var c=a.style;\"opacity\"in c?c.opacity=b:\"MozOpacity\"in c?c.MozOpacity=b:\"filter\"in c&&(c.filter=\"\"===b?\"\":\"alpha(opacity=\"+100*b+\")\")}function ph(a,b){a.style.display=b?\"\":\"none\"}function qh(a){return\"rtl\"==Xg(a,\"direction\")}function rh(a,b){if(\/^\\d+px?$\/.test(b))return parseInt(b,10);var c=a.style.left,d=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;a.style.left=b;var e=a.style.pixelLeft;a.style.left=c;a.runtimeStyle.left=d;return e}\nfunction sh(a,b){var c=a.currentStyle?a.currentStyle[b]:null;return c?rh(a,c):0}var th={thin:2,medium:4,thick:6};function uh(a,b){if(\"none\"==(a.currentStyle?a.currentStyle[b+\"Style\"]:null))return 0;var c=a.currentStyle?a.currentStyle[b+\"Width\"]:null;return c in th?th[c]:rh(a,c)}\nfunction vh(a){if(jd&&!zd(9)){var b=uh(a,\"borderLeft\"),c=uh(a,\"borderRight\"),d=uh(a,\"borderTop\");a=uh(a,\"borderBottom\");return new Hg(d,c,a,b)}b=Wg(a,\"borderLeftWidth\");c=Wg(a,\"borderRightWidth\");d=Wg(a,\"borderTopWidth\");a=Wg(a,\"borderBottomWidth\");return new Hg(parseFloat(d),parseFloat(c),parseFloat(a),parseFloat(b))}var wh=\/[^\\d]+$\/,xh={cm:1,\"in\":1,mm:1,pc:1,pt:1},yh={em:1,ex:1};\nfunction zh(a){var b=Xg(a,\"fontSize\"),c;c=(c=b.match(wh))&&c[0]||null;if(b&&\"px\"==c)return parseInt(b,10);if(jd){if(c in xh)return rh(a,b);if(a.parentNode&&1==a.parentNode.nodeType&&c in yh)return a=a.parentNode,c=Xg(a,\"fontSize\"),rh(a,b==c?\"1em\":b)}c=I(\"SPAN\",{style:\"visibility:hidden;position:absolute;line-height:0;padding:0;margin:0;border:0;height:1em;\"});a.appendChild(c);b=c.offsetHeight;be(c);return b}jd&&yd(12);var Ah=ld?\"webkit\":kd?\"moz\":jd?\"ms\":id?\"o\":\"\";function Bh(a){var b=a.__yt_uid_key;b||(b=Ch(),a.__yt_uid_key=b);return b}var Ch=u(\"yt.dom.getNextId_\");if(!Ch){Ch=function(){return++Dh};q(\"yt.dom.getNextId_\",Ch,void 0);var Dh=0}function Eh(a,b){var c=Md(a,null,b);return c.length?c[0]:null}function Fh(a,b){if(a in b)return b[a];var c=Ah+a.charAt(0).toUpperCase()+a.substr(1);if(c in b)return b[c]}function Gh(a,b){var c;mb(a,function(a){c=Fh(a,b);return!!c});return c};function Hh(a){if(a=a||window.event){this.event=a;for(var b in a)b in Ih||(this[b]=a[b]);this.scale=a.scale;this.rotation=a.rotation;(b=a.target||a.srcElement)&&3==b.nodeType&&(b=b.parentNode);this.target=b;if(b=a.relatedTarget)try{b=b.nodeName?b:null}catch(c){b=null}else\"mouseover\"==this.type?b=a.fromElement:\"mouseout\"==this.type&&(b=a.toElement);this.relatedTarget=b;this.clientX=void 0!=a.clientX?a.clientX:a.pageX;this.clientY=void 0!=a.clientY?a.clientY:a.pageY;this.keyCode=a.keyCode?a.keyCode:\na.which;this.charCode=a.charCode||(\"keypress\"==this.type?this.keyCode:0);this.altKey=a.altKey;this.ctrlKey=a.ctrlKey;this.shiftKey=a.shiftKey;\"MozMousePixelScroll\"==this.type?(this.wheelDeltaX=a.axis==a.HORIZONTAL_AXIS?a.detail:0,this.wheelDeltaY=a.axis==a.HORIZONTAL_AXIS?0:a.detail):window.opera?(this.wheelDeltaX=0,this.wheelDeltaY=a.detail):0==a.wheelDelta%120?\"WebkitTransform\"in document.documentElement.style?window.chrome&&0==navigator.platform.indexOf(\"Mac\")?(this.wheelDeltaX=a.wheelDeltaX\/-30,\nthis.wheelDeltaY=a.wheelDeltaY\/-30):(this.wheelDeltaX=a.wheelDeltaX\/-1.2,this.wheelDeltaY=a.wheelDeltaY\/-1.2):(this.wheelDeltaX=0,this.wheelDeltaY=a.wheelDelta\/-1.6):(this.wheelDeltaX=a.wheelDeltaX\/-3,this.wheelDeltaY=a.wheelDeltaY\/-3);this.j=a.pageX;this.o=a.pageY}}function Jh(a){if(document.body&&document.documentElement){var b=document.body.scrollTop+document.documentElement.scrollTop;a.j=a.clientX+(document.body.scrollLeft+document.documentElement.scrollLeft);a.o=a.clientY+b}}\nfunction Kh(a){n(a.j)||Jh(a);return a.j}function Lh(a){n(a.o)||Jh(a);return a.o}f=Hh.prototype;f.type=\"\";f.target=null;f.relatedTarget=null;f.currentTarget=null;f.data=null;f.source=null;f.state=null;f.keyCode=0;f.charCode=0;f.altKey=!1;f.ctrlKey=!1;f.shiftKey=!1;f.clientX=0;f.clientY=0;f.wheelDeltaX=0;f.wheelDeltaY=0;f.rotation=0;f.scale=1;f.touches=null;f.changedTouches=null;f.preventDefault=function(){this.event&&(this.event.returnValue=!1,this.event.preventDefault&&this.event.preventDefault())};\nf.fh=function(){return this.event?!1===this.event.returnValue:!1};f.stopPropagation=function(){this.event&&(this.event.cancelBubble=!0,this.event.stopPropagation&&this.event.stopPropagation())};f.stopImmediatePropagation=function(){this.event&&(this.event.cancelBubble=!0,this.event.stopImmediatePropagation&&this.event.stopImmediatePropagation())};var Ih={stopImmediatePropagation:1,stopPropagation:1,preventMouseEvent:1,preventManipulation:1,preventDefault:1,layerX:1,layerY:1,scale:1,rotation:1};var Mh=u(\"yt.events.listeners_\")||{};q(\"yt.events.listeners_\",Mh,void 0);var Nh=u(\"yt.events.counter_\")||{count:0};q(\"yt.events.counter_\",Nh,void 0);function Oh(a,b,c,d){return Yb(Mh,function(e){return e[0]==a&&e[1]==b&&e[2]==c&&e[4]==!!d})}\nfunction Ph(a,b,c,d){if(!a||!a.addEventListener&&!a.attachEvent)return\"\";d=!!d;var e=Oh(a,b,c,d);if(e)return e;var e=++Nh.count+\"\",g=!(\"mouseenter\"!=b&&\"mouseleave\"!=b||!a.addEventListener||\"onmouseenter\"in document),h;h=g?function(d){d=new Hh(d);if(!ve(d.relatedTarget,function(b){return b==a},!0))return d.currentTarget=a,d.type=b,c.call(a,d)}:function(b){b=new Hh(b);b.currentTarget=a;return c.call(a,b)};h=Zf(h);Mh[e]=[a,b,c,h,d];a.addEventListener?\"mouseenter\"==b&&g?a.addEventListener(\"mouseover\",\nh,d):\"mouseleave\"==b&&g?a.addEventListener(\"mouseout\",h,d):\"mousewheel\"==b&&\"MozBoxSizing\"in document.documentElement.style?a.addEventListener(\"MozMousePixelScroll\",h,d):a.addEventListener(b,h,d):a.attachEvent(\"on\"+b,h);return e}function Qh(a,b){var c;c=Ph(a,\"playing\",function(){Rh(c);b.apply(a,arguments)},void 0)}function Sh(a,b,c,d){return Th(a,b,c,function(a){return tg(a,d)})}\nfunction Th(a,b,c,d){var e=a||document;return Ph(e,b,function(a){var b=ve(a.target,function(a){return a===e||d(a)},!0);b&&b!==e&&!b.disabled&&(a.currentTarget=b,c.call(b,a))})}function Rh(a){a&&(\"string\"==typeof a&&(a=[a]),D(a,function(a){if(a in Mh){var c=Mh[a],d=c[0],e=c[1],g=c[3],c=c[4];d.removeEventListener?d.removeEventListener(e,g,c):d.detachEvent&&d.detachEvent(\"on\"+e,g);delete Mh[a]}}))}function Uh(a){for(var b in Mh)Mh[b][0]==a&&Rh(b)}\nfunction Vh(a){a=a||window.event;a=a.target||a.srcElement;3==a.nodeType&&(a=a.parentNode);return a}function Wh(a){a=a||window.event;var b=a.pageX,c=a.pageY;document.body&&document.documentElement&&(b||(b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft),c||(c=a.clientY+document.body.scrollTop+document.documentElement.scrollTop));return new Wc(b,c)}function Xh(a){a=a||window.event;a.returnValue=!1;a.preventDefault&&a.preventDefault()}\nfunction Yh(a){a=a||window.event;return!1===a.returnValue||a.fh&&a.fh()}function Zh(a,b){if(document.createEvent){var c=document.createEvent(\"HTMLEvents\");c.initEvent(b,!0,!0);a.dispatchEvent(c)}else c=document.createEventObject(),a.fireEvent(\"on\"+b,c)};function $h(){return!!Gh([\"fullscreenEnabled\",\"fullScreenEnabled\"],document)}function ai(){return Gh([\"fullscreenElement\",\"fullScreenElement\"],document)};function bi(a){a=a||{};this.url=a.url||\"\";this.urlV9As2=a.url_v9as2||\"\";this.args=a.args||dc(ci);this.assets=a.assets||{};this.attrs=a.attrs||dc(di);this.params=a.params||dc(ei);this.minVersion=a.min_version||\"8.0.0\";this.fallback=a.fallback||null;this.fallbackMessage=a.fallbackMessage||null;this.html5=!!a.html5;this.disable=a.disable||{};this.loaded=!!a.loaded;this.messages=a.messages||{}}var ci={enablejsapi:1},di={},ei={allowscriptaccess:\"always\",allowfullscreen:\"true\",bgcolor:\"#000000\"};\nbi.prototype.clone=function(){var a=new bi,b;for(b in this){var c=this[b];\"object\"==ca(c)?a[b]=dc(c):a[b]=c}return a};var fi=document.currentScript&&-1!=document.currentScript.src.indexOf(\"?loadGamesSDK\")?\"\/cast_game_sender.js\":\"\/cast_sender.js\",gi=\"boadgeojelhgndaghljhdicfkmllpafd dliochdbjfkdbacpmhlcpmleaejidimm hfaagokkkhdbgiakmmlclaapfelnkoah fmfcbgogabcbclcofgocippekhfcmgfj enhhojjnijigcajfphajepfemndkmdlo eojlgccfgnjlphjnlopmadngcgmmdgpk\".split(\" \"),hi=[\"fjhoaacokmgbjemoflkofnenfaiekifl\",\"ekpaaapppgpmolpcldedioblbkmijaca\",\"lhkfccafpkdlaodkicmokbmfapjadkij\",\"ibiljbkambkbohapfhoonkcpcikdglop\"],ii=window.navigator.j?\ngi.concat(hi):gi;function ji(a){window.chrome?ki(0,a):a(null)}function ki(a,b){a==ii.length?b(null):li(ii[a],function(c){c?b(ii[a]):ki(a+1,b)})}function li(a,b){var c=new XMLHttpRequest;c.onreadystatechange=function(){4==c.readyState&&200==c.status&&b(!0)};c.onerror=function(){b(!1)};try{c.open(\"GET\",\"chrome-extension:\/\/\"+a+fi,!0),c.send()}catch(d){b(!1)}}\nfunction mi(){ji(function(a){if(a){window.chrome=window.chrome||{};window.chrome.cast=window.chrome.cast||{};window.chrome.cast.extensionId=a;var b=document.createElement(\"script\");b.src=\"chrome-extension:\/\/\"+a+fi;(document.head||document.documentElement).appendChild(b)}else(a=window.__onGCastApiAvailable)&&\"function\"==typeof a&&a(!1,\"No cast extension found\")})};var ni=cd(\"Firefox\"),oi=hd()||cd(\"iPod\"),pi=cd(\"iPad\"),qi=cd(\"Android\")&&!(fd()||cd(\"Firefox\")||dd()||cd(\"Silk\")),ri=fd(),si=cd(\"Safari\")&&!(fd()||cd(\"Coast\")||dd()||ed()||cd(\"Silk\")||cd(\"Android\"))&&!(hd()||cd(\"iPad\")||cd(\"iPod\"));var ti=z(),ui=null,vi=Array(50),wi=-1,xi=!1;function yi(a){zi();ui.push(a);Ai(ui)}function Bi(a){var b=u(\"yt.mdx.remote.debug.handlers_\");ub(b||[],a)}function Ci(a,b){zi();var c=ui,d=Di(a,String(b));rb(c)?Ei(d):(Ai(c),D(c,function(a){a(d)}))}function zi(){ui||(ui=u(\"yt.mdx.remote.debug.handlers_\")||[],q(\"yt.mdx.remote.debug.handlers_\",ui,void 0))}function Ei(a){var b=(wi+1)%50;wi=b;vi[b]=a;xi||(xi=49==b)}\nfunction Ai(a){var b=vi;if(b[0]){var c=wi,d=xi?c:-1;do{var d=(d+1)%50,e=b[d];D(a,function(a){a(e)})}while(d!=c);vi=Array(50);wi=-1;xi=!1}}function Di(a,b){var c=(z()-ti)\/1E3;c.toFixed&&(c=c.toFixed(3));var d=[];d.push(\"[\",c+\"s\",\"] \");d.push(\"[\",\"yt.mdx.remote\",\"] \");d.push(a+\": \"+b,\"\\n\");return d.join(\"\")};function Fi(a){a=a||{};this.name=a.name||\"\";this.id=a.id||a.screenId||\"\";this.token=a.token||a.loungeToken||\"\";this.uuid=a.uuid||a.dialId||\"\"}function Gi(a,b){return!!b&&(a.id==b||a.uuid==b)}function Hi(a,b){return a||b?!a!=!b?!1:a.id==b.id&&a.token==b.token&&a.name==b.name&&a.uuid==b.uuid:!0}function Ii(a){return{name:a.name,screenId:a.id,loungeToken:a.token,dialId:a.uuid}}function Ji(a){return new Fi(a)}function Ki(a){return ea(a)?E(a,Ji):[]}\nfunction Li(a){return a?'{name:\"'+a.name+'\",id:'+a.id.substr(0,6)+\"..,token:\"+(a.token?\"..\"+a.token.slice(-6):\"-\")+\",uuid:\"+(a.uuid?\"..\"+a.uuid.slice(-6):\"-\")+\"}\":\"null\"}function Mi(a){return ea(a)?\"[\"+E(a,Li).join(\",\")+\"]\":\"null\"};function Ni(a,b,c){a&&(a.dataset?a.dataset[Oi(b)]=c:a.setAttribute(\"data-\"+b,c))}function Pi(a,b){return a?a.dataset?a.dataset[Oi(b)]:a.getAttribute(\"data-\"+b):null}var Qi={};function Oi(a){return Qi[a]||(Qi[a]=String(a).replace(\/\\-([a-z])\/g,function(a,c){return c.toUpperCase()}))};function P(){this.Pa=this.Pa;this.Ga=this.Ga}P.prototype.Pa=!1;P.prototype.isDisposed=function(){return this.Pa};P.prototype.dispose=function(){this.Pa||(this.Pa=!0,this.P())};function R(a,b){Ri(a,oa(Si,b))}function Ri(a,b){a.Pa?b.call(void 0):(a.Ga||(a.Ga=[]),a.Ga.push(n(void 0)?y(b,void 0):b))}P.prototype.P=function(){if(this.Ga)for(;this.Ga.length;)this.Ga.shift()()};function Ti(a){return a&&\"function\"==typeof a.isDisposed?a.isDisposed():!1}\nfunction Si(a){a&&\"function\"==typeof a.dispose&&a.dispose()}function Ui(a){for(var b=0,c=arguments.length;b=c.length)throw ze;var d;d=c.key(b++);if(a)return d;d=c.getItem(d);if(!x(d))throw\"Storage mechanism: Invalid value was encountered\";return d};return d};f.clear=function(){this.j.clear()};f.key=function(a){return this.j.key(a)};function ij(){var a=null;try{a=window.localStorage||null}catch(b){}this.j=a}A(ij,hj);function jj(){var a=null;try{a=window.sessionStorage||null}catch(b){}this.j=a}A(jj,hj);function kj(a){this.j=a}kj.prototype.set=function(a,b){n(b)?this.j.set(a,Bg(b)):this.j.remove(a)};kj.prototype.get=function(a){var b;try{b=this.j.get(a)}catch(c){return}if(null!==b)try{return zg(b)}catch(d){throw\"Storage: Invalid value was encountered\";}};kj.prototype.remove=function(a){this.j.remove(a)};function lj(a){this.j=a}A(lj,kj);function mj(a){this.data=a}function nj(a){return!n(a)||a instanceof mj?a:new mj(a)}lj.prototype.set=function(a,b){lj.L.set.call(this,a,nj(b))};lj.prototype.o=function(a){a=lj.L.get.call(this,a);if(!n(a)||a instanceof Object)return a;throw\"Storage: Invalid value was encountered\";};lj.prototype.get=function(a){if(a=this.o(a)){if(a=a.data,!n(a))throw\"Storage: Invalid value was encountered\";}else a=void 0;return a};function oj(a){this.j=a}A(oj,lj);function pj(a){var b=a.creation;a=a.expiration;return!!a&&az()}oj.prototype.set=function(a,b,c){if(b=nj(b)){if(c){if(ca.status)e=Wj(c,a,b.Pv);if(d)a:{switch(c){case \"XML\":d=0==parseInt(e&&e.return_code,10);break a;case \"RAW\":d=!0;break a}d=!!e}var e=e||{},g=b.context||m;d?b.cb&&b.cb.call(g,a,e):b.onError&&b.onError.call(g,a,e);b.Kb&&b.Kb.call(g,a,e)}},b.method,h,b.headers,b.responseType,b.withCredentials);b.Zc&&0Va(a,\"10.0\")&&(this.o=!1))}function ek(a,b,c,d){var e=a.j;if(n(d)?d:a.o)e=\"https:\/\/\"+a.A+a.port+a.j;return bf(e+b,c||{})}\nfunction fk(a,b,c,d,e){a={format:\"JSON\",method:\"POST\",context:a,timeout:5E3,withCredentials:!1,cb:oa(a.C,d,!0),onError:oa(a.B,e),Zc:oa(a.D,e)};c&&(a.Bb=c,a.headers={\"Content-Type\":\"application\/x-www-form-urlencoded\"});return Vj(b,a)}dk.prototype.C=function(a,b,c,d){b?a(d):a({text:c.responseText})};dk.prototype.B=function(a,b){a(Error(\"Request error: \"+b.status))};dk.prototype.D=function(a){a(Error(\"request timed out\"))};function gk(a){a&&(this.id=a.id||\"\",this.name=a.name||\"\",this.j=a.activityId||\"\",this.status=a.status||\"UNKNOWN\")}gk.prototype.id=\"\";gk.prototype.name=\"\";gk.prototype.j=\"\";gk.prototype.status=\"UNKNOWN\";gk.prototype.toString=function(){return\"{id:\"+this.id+\",name:\"+this.name+\",activityId:\"+this.j+\",status:\"+this.status+\"}\"};function hk(){return\"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(\/[xy]\/g,function(a){var b=16*Math.random()|0;return(\"x\"==a?b:b&3|8).toString(16)})}function ik(a){return E(a,function(a){return{key:a.id,name:a.name}})}function jk(a){return E(a,function(a){return new gk(a)})}function kk(a,b){return F(a,function(a){return a.id==b})}function lk(a,b){return F(a,function(a){return a||b?!a!=!b?!1:a.id==b.id:!0})}function mk(a,b){return F(a,function(a){return Gi(a,b)})};function S(){P.call(this);this.T=new Vi;R(this,this.T)}A(S,P);S.prototype.subscribe=function(a,b,c){return this.isDisposed()?0:this.T.subscribe(a,b,c)};S.prototype.unsubscribe=function(a,b,c){return this.isDisposed()?!1:this.T.unsubscribe(a,b,c)};S.prototype.Nb=function(a){return this.isDisposed()?!1:this.T.Nb(a)};S.prototype.M=function(a,b){return this.isDisposed()?!1:this.T.M.apply(this.T,arguments)};function nk(a){S.call(this);this.D=a;this.screens=[]}A(nk,S);f=nk.prototype;f.Zb=function(){return this.screens};f.contains=function(a){return!!lk(this.screens,a)};f.get=function(a){return a?mk(this.screens,a):null};function ok(a,b){var c=a.get(b.uuid)||a.get(b.id);if(c){var d=c.name;c.id=b.id||c.id;c.name=b.name;c.token=b.token;c.uuid=b.uuid||c.uuid;return c.name!=d}a.screens.push(b);return!0}\nfunction pk(a,b){var c=a.screens.length!=b.length;a.screens=kb(a.screens,function(a){return!!lk(b,a)});for(var d=0,e=b.length;d=sk.length?this.M(\"pairingFailed\",Error(\"DIAL polling timed out\")):(a=sk[this.A],this.o=L(y(this.bs,this),a),this.A++):this.M(\"pairingFailed\",Error(\"Server error \"+a.status))};f.lD=function(){this.j=null;this.M(\"pairingFailed\",Error(\"Server not responding\"))};function tk(a,b){this.o=a;this.j=b+\"::\"}A(tk,gj);tk.prototype.set=function(a,b){this.o.set(this.j+a,b)};tk.prototype.get=function(a){return this.o.get(this.j+a)};tk.prototype.remove=function(a){this.o.remove(this.j+a)};tk.prototype.Xb=function(a){var b=this.o.Xb(!0),c=this,d=new Ae;d.next=function(){for(var d=b.next();d.substr(0,c.j.length)!=c.j;)d=b.next();return a?d.substr(c.j.length):c.o.get(d)};return d};function uk(a){var b=new ij;return b.isAvailable()?a?new tk(b,a):b:null};function vk(a){this.j=new Ee;if(a){a=Ke(a);for(var b=a.length,c=0;cc)return!1;!(b instanceof vk)&&5c?\"\":0==c?\";expires=\"+(new Date(1970,1,1)).toUTCString():\";expires=\"+(new Date(z()+1E3*c)).toUTCString();this.j.cookie=a+\"=\"+b+e+d+c+g};\nf.get=function(a,b){for(var c=a+\"=\",d=(this.j.cookie||\"\").split(Ak),e=0,g;g=d[e];e++){if(0==g.lastIndexOf(c,0))return g.substr(c.length);if(g==a)return\"\"}return b};f.remove=function(a,b,c){var d=n(this.get(a));this.set(a,\"\",0,b,c);return d};f.Na=function(){return Bk(this).keys};f.Qa=function(){return Bk(this).values};f.isEmpty=function(){return!this.j.cookie};f.Za=function(){return this.j.cookie?(this.j.cookie||\"\").split(Ak).length:0};\nf.vf=function(a){for(var b=Bk(this).values,c=0;c \"+b);if(this.j){var c=this.j.A;if(!a||c&&c.id!=a)Bl(\"Unsetting old screen status: \"+this.j.o.friendlyName),Si(this.j),this.j=null}if(a&&b){if(!this.j){c=mk(this.o.Zb(),a);if(!c){Bl(\"setConnectedScreenStatus: Unknown screen.\");return}var d=Cl(this,c);d||(Bl(\"setConnectedScreenStatus: Connected receiver not custom...\"),d=new chrome.cast.Receiver(c.uuid?c.uuid:c.id,c.name),d.receiverType=chrome.cast.ReceiverType.CUSTOM,this.A.push(d),chrome.cast.setCustomReceivers(this.A,\nv,y(function(a){this.ab(\"Failed to set initial custom receivers: \"+Bg(a))},this)));Bl(\"setConnectedScreenStatus: new active receiver: \"+d.friendlyName);Dl(this,new wl(this.o,d),!0)}this.j.Em(b)}else Bl(\"setConnectedScreenStatus: no screen.\")};function Cl(a,b){return b?F(a.A,function(a){return Gi(b,a.label)},a):null}f.BC=function(a){this.isDisposed()?this.ab(\"Setting connection data on disposed cast v2\"):this.j?this.j.Rf(a):this.ab(\"Setting connection data without a session\")};\nf.stopSession=function(){this.isDisposed()?this.ab(\"Stopping session on disposed cast v2\"):this.j?(this.j.stop(),Si(this.j),this.j=null):Bl(\"Stopping non-existing session\")};f.requestSession=function(){chrome.cast.requestSession(y(this.wq,this),y(this.eB,this))};f.P=function(){this.o.unsubscribe(\"onlineScreenChange\",y(this.es,this));window.chrome&&chrome.cast&&chrome.cast.removeReceiverActionListener(this.B);Bi(yl);Si(this.j);xl.L.P.call(this)};function Bl(a){Ci(\"Controller\",a)}\nf.ab=function(a){Ci(\"Controller\",a)};function yl(a){window.chrome&&chrome.cast&&chrome.cast.logMessage&&chrome.cast.logMessage(a)}function Al(a){return a.C||!!a.A.length||!!a.j}function Dl(a,b,c){Si(a.j);(a.j=b)?(c?a.M(\"yt-remote-cast2-receiver-resumed\",b.o):a.M(\"yt-remote-cast2-receiver-selected\",b.o),b.subscribe(\"sessionScreen\",y(a.xq,a,b)),b.A?a.M(\"yt-remote-cast2-session-change\",b.A):c&&a.j.Rf(null)):a.M(\"yt-remote-cast2-session-change\",null)}\nf.xq=function(a,b){this.j==a&&(b||Dl(this,null),this.M(\"yt-remote-cast2-session-change\",b))};\nf.UA=function(a,b){if(!this.isDisposed())if(a)switch(Bl(\"onReceiverAction_ \"+a.label+\" \/ \"+a.friendlyName+\"-- \"+b),b){case chrome.cast.ReceiverAction.CAST:if(this.j)if(this.j.o.label!=a.label)Bl(\"onReceiverAction_: Stopping active receiver: \"+this.j.o.friendlyName),this.j.stop();else{Bl(\"onReceiverAction_: Casting to active receiver.\");this.j.A&&this.M(\"yt-remote-cast2-session-change\",this.j.A);break}switch(a.receiverType){case chrome.cast.ReceiverType.CUSTOM:Dl(this,new wl(this.o,a));break;case chrome.cast.ReceiverType.DIAL:Dl(this,\nnew tl(this.o,a));break;case chrome.cast.ReceiverType.CAST:Dl(this,new pl(this.o,a));break;default:this.ab(\"Unknown receiver type: \"+a.receiverType);return}break;case chrome.cast.ReceiverAction.STOP:this.j&&this.j.o.label==a.label?this.j.stop():this.ab(\"Stopping receiver w\/o session: \"+a.friendlyName)}else this.ab(\"onReceiverAction_ called without receiver.\")};\nf.Vz=function(a){if(this.isDisposed())return Promise.reject(Error(\"disposed\"));var b=a.receiver;b.receiverType!=chrome.cast.ReceiverType.DIAL&&(this.ab(\"Not DIAL receiver: \"+b.friendlyName),b.receiverType=chrome.cast.ReceiverType.DIAL);var c=this.j?this.j.o:null;if(!c||c.label!=b.label)return this.ab(\"Receiving DIAL launch request for non-clicked DIAL receiver: \"+b.friendlyName),Promise.reject(Error(\"illegal DIAL launch\"));if(c&&c.label==b.label&&c.receiverType!=chrome.cast.ReceiverType.DIAL){if(this.j.A)return Bl(\"Reselecting dial screen.\"),\nthis.M(\"yt-remote-cast2-session-change\",this.j.A),Promise.resolve(new chrome.cast.DialLaunchResponse(!1));this.ab('Changing CAST intent from \"'+c.receiverType+'\" to \"dial\" for '+b.friendlyName);Dl(this,new tl(this.o,b))}b=this.j;b.G=a;return b.G.appState==chrome.cast.DialAppState.RUNNING?new Promise(y(b.yy,b,(b.G.extraData||{}).screenId||null)):new Promise(y(b.Ml,b))};\nf.wq=function(a){if(!this.isDisposed()){Bl(\"New cast session ID: \"+a.sessionId);var b=a.receiver;if(b.receiverType!=chrome.cast.ReceiverType.CUSTOM){if(!this.j)if(b.receiverType==chrome.cast.ReceiverType.CAST)Bl(\"Got resumed cast session before resumed mdx connection.\"),Dl(this,new pl(this.o,b),!0);else{this.ab(\"Got non-cast session without previous mdx receiver event, or mdx resume.\");return}var c=this.j.o,d=mk(this.o.Zb(),c.label);d&&Gi(d,b.label)&&c.receiverType!=chrome.cast.ReceiverType.CAST&&\nb.receiverType==chrome.cast.ReceiverType.CAST&&(Bl(\"onSessionEstablished_: manual to cast session change \"+b.friendlyName),Si(this.j),this.j=new pl(this.o,b),this.j.subscribe(\"sessionScreen\",y(this.xq,this,this.j)),this.j.Rf(null));this.j.Dm(a)}}};f.pD=function(){return this.j?this.j.gs():null};f.eB=function(a){this.isDisposed()||(this.ab(\"Failed to estabilish a session: \"+Bg(a)),a.code!=chrome.cast.ErrorCode.CANCEL&&Dl(this,null))};\nf.XA=function(a){Bl(\"Receiver availability updated: \"+a);if(!this.isDisposed()){var b=Al(this);this.C=a==chrome.cast.ReceiverAvailability.AVAILABLE;Al(this)!=b&&this.M(\"yt-remote-cast2-availability-change\",Al(this))}};\nfunction zl(a){var b=a.o.cs(),c=a.j&&a.j.o;a=E(b,function(a){c&&Gi(a,c.label)&&(c=null);var b=a.uuid?a.uuid:a.id,g=Cl(this,a);g?(g.label=b,g.friendlyName=a.name):(g=new chrome.cast.Receiver(b,a.name),g.receiverType=chrome.cast.ReceiverType.CUSTOM);return g},a);c&&(c.receiverType!=chrome.cast.ReceiverType.CUSTOM&&(c=new chrome.cast.Receiver(c.label,c.friendlyName),c.receiverType=chrome.cast.ReceiverType.CUSTOM),a.push(c));return a}\nf.es=function(){if(!this.isDisposed()){var a=Al(this);this.A=zl(this);Bl(\"Updating custom receivers: \"+Bg(this.A));chrome.cast.setCustomReceivers(this.A,v,y(function(){this.ab(\"Failed to set custom receivers.\")},this));var b=Al(this);b!=a&&this.M(\"yt-remote-cast2-availability-change\",b)}};xl.prototype.setLaunchParams=xl.prototype.BC;xl.prototype.setConnectedScreenStatus=xl.prototype.AC;xl.prototype.stopSession=xl.prototype.stopSession;xl.prototype.getCastSession=xl.prototype.pD;\nxl.prototype.requestSession=xl.prototype.requestSession;xl.prototype.init=xl.prototype.init;xl.prototype.dispose=xl.prototype.dispose;function El(a,b,c){Fl()?Hl(b)&&(Il(!0),window.chrome&&chrome.cast&&chrome.cast.isAvailable?Jl(a,c):(window.__onGCastApiAvailable=function(b,e){b?Jl(a,c):(Kl(\"Failed to load cast API: \"+e),Ll(!1),Il(!1),yj(\"yt-remote-cast-available\"),yj(\"yt-remote-cast-receiver\"),Ml(),c(!1))},mi())):Gl(\"Cannot initialize because not running Chrome\")}function Ml(){Gl(\"dispose\");var a=Nl();a&&a.dispose();Ol=null;q(\"yt.mdx.remote.cloudview.instance_\",null,void 0);Pl(!1);cj(Ql);Ql.length=0}\nfunction Rl(){return!!xj(\"yt-remote-cast-installed\")}function Sl(){var a=xj(\"yt-remote-cast-receiver\");return a?Ha(a.friendlyName):null}function Tl(){return Rl()?Nl()?Ol.getCastSession():(Kl(\"getCastSelector: Cast is not initialized.\"),null):(Kl(\"getCastSelector: Cast API is not installed!\"),null)}\nfunction Ul(){Rl()?Nl()?Vl()?(Gl(\"Requesting cast selector.\"),Ol.requestSession()):(Gl(\"Wait for cast API to be ready to request the session.\"),Ql.push(aj(\"yt-remote-cast2-api-ready\",Ul))):Kl(\"requestCastSelector: Cast is not initialized.\"):Kl(\"requestCastSelector: Cast API is not installed!\")}function Wl(a){Vl()?Nl().setLaunchParams(a):Kl(\"setLaunchParams called before ready.\")}\nfunction Xl(){var a=Yl();Vl()?Nl().setConnectedScreenStatus(a,\"YouTube TV\"):Kl(\"setConnectedScreenStatus called before ready.\")}var Ol=null;function Fl(){var a;a=0<=$c.search(\/\\ (CrMo|Chrome|CriOS)\\\/\/);return ri||a}function Zl(a,b){Ol.init(a,b)}\nfunction Hl(a){var b=!1;if(!Ol){var c=u(\"yt.mdx.remote.cloudview.instance_\");c||(c=new xl(a),c.subscribe(\"yt-remote-cast2-availability-change\",function(a){vj(\"yt-remote-cast-available\",a);dj(\"yt-remote-cast2-availability-change\",a)}),c.subscribe(\"yt-remote-cast2-receiver-selected\",function(a){Gl(\"onReceiverSelected: \"+a.friendlyName);vj(\"yt-remote-cast-receiver\",a);dj(\"yt-remote-cast2-receiver-selected\",a)}),c.subscribe(\"yt-remote-cast2-receiver-resumed\",function(a){Gl(\"onReceiverResumed: \"+a.friendlyName);\nvj(\"yt-remote-cast-receiver\",a)}),c.subscribe(\"yt-remote-cast2-session-change\",function(a){Gl(\"onSessionChange: \"+Li(a));a||yj(\"yt-remote-cast-receiver\");dj(\"yt-remote-cast2-session-change\",a)}),q(\"yt.mdx.remote.cloudview.instance_\",c,void 0),b=!0);Ol=c}Gl(\"cloudview.createSingleton_: \"+b);return b}function Nl(){Ol||(Ol=u(\"yt.mdx.remote.cloudview.instance_\"));return Ol}\nfunction Jl(a,b){Ll(!0);Il(!1);Zl(a,function(a){a?(Pl(!0),dj(\"yt-remote-cast2-api-ready\")):(Kl(\"Failed to initialize cast API.\"),Ll(!1),yj(\"yt-remote-cast-available\"),yj(\"yt-remote-cast-receiver\"),Ml());b(a)})}function Gl(a){Ci(\"cloudview\",a)}function Kl(a){Ci(\"cloudview\",a)}function Ll(a){Gl(\"setCastInstalled_ \"+a);vj(\"yt-remote-cast-installed\",a)}function Vl(){return!!u(\"yt.mdx.remote.cloudview.apiReady_\")}function Pl(a){Gl(\"setApiReady_ \"+a);q(\"yt.mdx.remote.cloudview.apiReady_\",a,void 0)}\nfunction Il(a){q(\"yt.mdx.remote.cloudview.initializing_\",a,void 0)}var Ql=[];function $l(a,b){this.action=a;this.params=b||null};function am(){if(!(\"cast\"in window))return!1;var a=window.cast||{};return\"ActivityStatus\"in a&&\"Api\"in a&&\"LaunchRequest\"in a&&\"Receiver\"in a}function bm(a){Ci(\"CAST\",a)}function cm(a){var b=dm();b&&b.logMessage&&b.logMessage(a)}function em(a){if(a.event.source==window&&a.event.data&&\"CastApi\"==a.event.data.source&&\"Hello\"==a.event.data.event)for(;fm.length;)fm.shift()()}\nfunction gm(){if(!u(\"yt.mdx.remote.castv2_\")&&!hm&&(rb(im)&&zb(im,Rk()),am())){var a=dm();a?(a.removeReceiverListener(\"YouTube\",jm),a.addReceiverListener(\"YouTube\",jm),bm(\"API initialized in the other binary\")):(a=new cast.Api,km(a),a.addReceiverListener(\"YouTube\",jm),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(function(){L(function(){window.location.reload(!0)},1E3)}),yi(cm),bm(\"API initialized\"));hm=!0}}\nfunction lm(){var a=dm();a&&(bm(\"API disposed\"),Bi(cm),a.setReloadTabRequestHandler&&a.setReloadTabRequestHandler(v),a.removeReceiverListener(\"YouTube\",jm),km(null));hm=!1;fm=null;(a=Oh(window,\"message\",em,!1))&&Rh(a)}function mm(a){var b=ob(im,function(b){return b.id==a.id});0<=b&&(im[b]={id:a.id,name:a.name,activityId:a.j,status:a.status})}\nfunction jm(a){a.length&&bm(\"Updating receivers: \"+Bg(a));nm(a);dj(\"yt-remote-cast-device-list-update\");D(om(),function(a){pm(a.id)});D(a,function(a){if(a.isTabProjected){var c=qm(a.id);bm(\"Detected device: \"+c.id+\" is tab projected. Firing DEVICE_TAB_PROJECTED event.\");L(function(){dj(\"yt-remote-cast-device-tab-projected\",c.id)},1E3)}})}\nfunction rm(a,b){bm(\"Updating \"+a+\" activity status: \"+Bg(b));var c=qm(a);c?(b.activityId&&(c.j=b.activityId),c.status=\"running\"==b.status?\"RUNNING\":\"stopped\"==b.status?\"STOPPED\":\"error\"==b.status?\"ERROR\":\"UNKNOWN\",\"RUNNING\"!=c.status&&(c.j=\"\"),mm(c),dj(\"yt-remote-cast-device-status-update\",c)):bm(\"Device not found\")}function om(){gm();return jk(im)}function nm(a){a=E(a,function(a){var c={id:a.id,name:Ha(a.name)};if(a=qm(a.id))c.activityId=a.j,c.status=a.status;return c});sb(im);zb(im,a)}\nfunction qm(a){var b=om();return F(b,function(b){return b.id==a})||null}function pm(a){var b=qm(a),c=dm();c&&b&&b.j&&c.getActivityStatus(b.j,function(b){\"error\"==b.status&&(b.status=\"stopped\");rm(a,b)})}function sm(a){gm();var b=qm(a),c=dm();c&&b&&b.j?(bm(\"Stopping cast activity\"),c.stopActivity(b.j,oa(rm,a))):bm(\"Dropping cast activity stop\")}function dm(){return u(\"yt.mdx.remote.castapi.api_\")}function km(a){q(\"yt.mdx.remote.castapi.api_\",a,void 0)}\nvar hm=!1,fm=null,im=u(\"yt.mdx.remote.castapi.devices_\")||[];q(\"yt.mdx.remote.castapi.devices_\",im,void 0);function tm(){};function um(){this.j=z()}new um;um.prototype.set=function(a){this.j=a};um.prototype.reset=function(){this.set(z())};um.prototype.get=function(){return this.j};function vm(a,b){this.type=a;this.currentTarget=this.target=b;this.defaultPrevented=this.o=!1;this.dr=!0}vm.prototype.stopPropagation=function(){this.o=!0};vm.prototype.preventDefault=function(){this.defaultPrevented=!0;this.dr=!1};function wm(a){a.stopPropagation()};var xm=!jd||zd(9),ym=jd&&!yd(\"9\");!ld||yd(\"528\");kd&&yd(\"1.9b\")||jd&&yd(\"8\")||id&&yd(\"9.5\")||ld&&yd(\"528\");kd&&!yd(\"8\")||jd&&yd(\"9\");var zm=\"ontouchstart\"in m||!!(m.document&&document.documentElement&&\"ontouchstart\"in document.documentElement)||!(!m.navigator||!m.navigator.msMaxTouchPoints);function Am(a,b){vm.call(this,a?a.type:\"\");this.relatedTarget=this.currentTarget=this.target=null;this.charCode=this.keyCode=this.button=this.screenY=this.screenX=this.clientY=this.clientX=0;this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1;this.j=this.state=null;a&&this.init(a,b)}A(Am,vm);\nAm.prototype.init=function(a,b){var c=this.type=a.type;this.target=a.target||a.srcElement;this.currentTarget=b;var d=a.relatedTarget;d?kd&&(Qg(d,\"nodeName\")||(d=null)):\"mouseover\"==c?d=a.fromElement:\"mouseout\"==c&&(d=a.toElement);this.relatedTarget=d;this.clientX=void 0!==a.clientX?a.clientX:a.pageX;this.clientY=void 0!==a.clientY?a.clientY:a.pageY;this.screenX=a.screenX||0;this.screenY=a.screenY||0;this.button=a.button;this.keyCode=a.keyCode||0;this.charCode=a.charCode||(\"keypress\"==c?a.keyCode:\n0);this.ctrlKey=a.ctrlKey;this.altKey=a.altKey;this.shiftKey=a.shiftKey;this.metaKey=a.metaKey;this.state=a.state;this.j=a;a.defaultPrevented&&this.preventDefault()};Am.prototype.stopPropagation=function(){Am.L.stopPropagation.call(this);this.j.stopPropagation?this.j.stopPropagation():this.j.cancelBubble=!0};\nAm.prototype.preventDefault=function(){Am.L.preventDefault.call(this);var a=this.j;if(a.preventDefault)a.preventDefault();else if(a.returnValue=!1,ym)try{if(a.ctrlKey||112<=a.keyCode&&123>=a.keyCode)a.keyCode=-1}catch(b){}};Am.prototype.F=function(){return this.j};var Bm=\"closure_listenable_\"+(1E6*Math.random()|0);function Cm(a){return!(!a||!a[Bm])}var Dm=0;function Em(a,b,c,d,e){this.listener=a;this.j=null;this.src=b;this.type=c;this.sf=!!d;this.Tc=e;this.key=++Dm;this.Zf=this.gi=!1}function Fm(a){a.Zf=!0;a.listener=null;a.j=null;a.src=null;a.Tc=null};function Gm(a){this.src=a;this.j={};this.o=0}Gm.prototype.add=function(a,b,c,d,e){var g=a.toString();a=this.j[g];a||(a=this.j[g]=[],this.o++);var h=Hm(a,b,d,e);-1c.keyCode||void 0!=c.returnValue)){a:{var g=!1;if(0==c.keyCode)try{c.keyCode=-1;break a}catch(h){g=!0}if(g||void 0==c.returnValue)c.returnValue=!0}c=[];for(g=d.currentTarget;g;g=g.parentNode)c.push(g);for(var g=a.type,k=c.length-1;!d.o&&0<=k;k--){d.currentTarget=c[k];var l=Xm(c[k],g,!0,d),e=e&&l}for(k=0;!d.o&&k>>0);function Om(a){if(ha(a))return a;a[Zm]||(a[Zm]=function(b){return a.handleEvent(b)});return a[Zm]};function T(){P.call(this);this.ud=new Gm(this);this.Ca=this;this.ea=null}A(T,P);T.prototype[Bm]=!0;f=T.prototype;f.Cj=function(a){this.ea=a};f.addEventListener=function(a,b,c,d){Nm(this,a,b,c,d)};f.removeEventListener=function(a,b,c,d){Vm(this,a,b,c,d)};\nf.Z=function(a){var b,c=this.ea;if(c){b=[];for(var d=1;c;c=c.ea)b.push(c),++d}c=this.Ca;d=a.type||a;if(x(a))a=new vm(a,c);else if(a instanceof vm)a.target=a.target||c;else{var e=a;a=new vm(d,c);gc(a,e)}var e=!0,g;if(b)for(var h=b.length-1;!a.o&&0<=h;h--)g=a.currentTarget=b[h],e=$m(g,d,!0,a)&&e;a.o||(g=a.currentTarget=c,e=$m(g,d,!0,a)&&e,a.o||(e=$m(g,d,!1,a)&&e));if(b)for(h=0;!a.o&&h=a.j.length)throw Error(\"Out of bounds exception\");return a.j.lengthb)break a}else if(3>b||3==b&&!id&&!mo(this.wb))break a;this.Je||4!=b||7==c||(8==c||0>=d?this.j.Dc(3):this.j.Dc(2));no(this);var e=this.wb.getStatus();this.Vg=e;var g=mo(this.wb);(this.Gc=200==e)?(4==b&&oo(this),this.C?(po(this,b,g),id&&this.Gc&&3==b&&(this.B.O(this.o,\"tick\",this.jC),this.o.start())):qo(this,g),this.Gc&&!this.Je&&(4==b?this.j.kj(this):(this.Gc=!1,ko(this)))):\n(this.Se=400==e&&0b.length)return go;var e=b.substr(d,c);a.Fh=d+c;return e}\nfunction uo(a,b){a.rh=z();ko(a);var c=b?window.location.hostname:\"\";a.he=a.Od.clone();K(a.he,\"DOMAIN\",c);K(a.he,\"t\",a.D);try{a.Ic=new ActiveXObject(\"htmlfile\")}catch(d){oo(a);a.Se=7;ro();so(a);return}var e=\"\";if(b){for(var g=\"\",h=0;h\"==k)g=g+\"\\\\x3e\";else{if(k in Oa)k=Oa[k];else if(k in Na)k=Oa[k]=Na[k];else{var l=k,p=k.charCodeAt(0);if(31p)l=k;else{if(256>p){if(l=\"\\\\x\",16>p||256p&&(l+=\n\"0\");l+=p.toString(16).toUpperCase()}k=Oa[k]=l}g+=k}}e+='